From b565c4d3e74e8e110bef201a082fa1302722a7c3 Mon Sep 17 00:00:00 2001 From: Roberto Vidal Date: Thu, 14 Nov 2019 08:20:38 +0100 Subject: [PATCH] fix: line numbers in several exercises and hints The introduction of `I AM NOT DONE` shifted the lines of all exercises, which now need adjustment. --- exercises/move_semantics/move_semantics2.rs | 2 +- exercises/threads/threads1.rs | 2 +- info.toml | 14 +++++++------- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/exercises/move_semantics/move_semantics2.rs b/exercises/move_semantics/move_semantics2.rs index 9233bb7..bd21fbb 100644 --- a/exercises/move_semantics/move_semantics2.rs +++ b/exercises/move_semantics/move_semantics2.rs @@ -1,5 +1,5 @@ // move_semantics2.rs -// Make me compile without changing line 10! +// Make me compile without changing line 13! // Execute `rustlings hint move_semantics2` for hints :) // I AM NOT DONE diff --git a/exercises/threads/threads1.rs b/exercises/threads/threads1.rs index 288ddd1..1785e8c 100644 --- a/exercises/threads/threads1.rs +++ b/exercises/threads/threads1.rs @@ -1,6 +1,6 @@ // threads1.rs // Make this compile! Execute `rustlings hint threads1` for hints :) -// The idea is the thread spawned on line 19 is completing jobs while the main thread is +// The idea is the thread spawned on line 21 is completing jobs while the main thread is // monitoring progress until 10 jobs are completed. If you see 6 lines // of "waiting..." and the program ends without timing out when running, // you've got it :) diff --git a/info.toml b/info.toml index 743ce2b..99628d1 100644 --- a/info.toml +++ b/info.toml @@ -5,7 +5,7 @@ name = "variables1" path = "exercises/variables/variables1.rs" mode = "compile" hint = """ -Hint: The declaration on line 5 is missing a keyword that is needed in Rust +Hint: The declaration on line 12 is missing a keyword that is needed in Rust to create a new variable binding.""" [[exercises]] @@ -15,7 +15,7 @@ mode = "compile" hint = """ The compiler message is saying that Rust cannot infer the type that the variable binding `x` has with what is given here. -What happens if you annotate line 5 with a type annotation? +What happens if you annotate line 7 with a type annotation? What if you give x a value? What if you do both? What type should x be, anyway? @@ -36,7 +36,7 @@ path = "exercises/variables/variables4.rs" mode = "compile" hint = """ Oops! In this exercise, we have a variable binding that we've created on -line 5, and we're trying to use it on line 6, but we haven't given it a +line 7, and we're trying to use it on line 8, but we haven't given it a value. We can't print out something that isn't there; try giving x a value! This is an error that can cause bugs that's very easy to make in any programming language -- thankfully the Rust compiler has caught this for us!""" @@ -365,8 +365,8 @@ name = "move_semantics1" path = "exercises/move_semantics/move_semantics1.rs" mode = "compile" hint = """ -So you've got the "cannot borrow immutable local variable `vec1` as mutable" error on line 11, -right? The fix for this is going to be adding one keyword, and the addition is NOT on line 11 +So you've got the "cannot borrow immutable local variable `vec1` as mutable" error on line 13, +right? The fix for this is going to be adding one keyword, and the addition is NOT on line 13 where the error is.""" [[exercises]] @@ -375,8 +375,8 @@ path = "exercises/move_semantics/move_semantics2.rs" mode = "compile" hint = """ So `vec0` is being *moved* into the function `fill_vec` when we call it on -line 7, which means it gets dropped at the end of `fill_vec`, which means we -can't use `vec0` again on line 10 (or anywhere else in `main` after the +line 10, which means it gets dropped at the end of `fill_vec`, which means we +can't use `vec0` again on line 13 (or anywhere else in `main` after the `fill_vec` call for that matter). We could fix this in a few ways, try them all! 1. Make another, separate version of the data that's in `vec0` and pass that