@@ -38,5 +38,5 @@ fn main() {
|
||||
|
||||
|
||||
|
||||
// Hint: The declaration on line 4 is missing a keyword that is needed in Rust
|
||||
// Hint: The declaration on line 5 is missing a keyword that is needed in Rust
|
||||
// to create a new variable binding.
|
||||
|
||||
@@ -40,7 +40,7 @@ fn main() {
|
||||
|
||||
// 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 4 with a type annotation?
|
||||
// What happens if you annotate line 5 with a type annotation?
|
||||
// What if you give x a value?
|
||||
// What if you do both?
|
||||
// What type should x be, anyway?
|
||||
|
||||
@@ -39,7 +39,7 @@ fn main() {
|
||||
|
||||
|
||||
// Oops! In this exercise, we have a variable binding that we've created on
|
||||
// line 4, and we're trying to use it on line 5, but we haven't given it a
|
||||
// line 5, and we're trying to use it on line 6, 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!
|
||||
|
||||
Reference in New Issue
Block a user