Skip to content

Commit

Permalink
Move caret under the 'x' variabe
Browse files Browse the repository at this point in the history
  • Loading branch information
EduardoBautista committed Aug 1, 2014
1 parent ea92a5e commit 69267b1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/doc/guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ let x;
```{ignore}
src/hello_world.rs:2:9: 2:10 error: cannot determine a type for this local variable: unconstrained type
src/hello_world.rs:2 let x;
^
^
```

Giving it a type will compile, though:
Expand All @@ -477,7 +477,7 @@ but it will still print "Hello, world!":
Compiling hello_world v0.1.0 (file:/home/you/projects/hello_world)
src/hello_world.rs:2:9: 2:10 warning: unused variable: `x`, #[warn(unused_variable)] on by default
src/hello_world.rs:2 let x: int;
^
^
```

Rust warns us that we never use the variable binding, but since we never use it,
Expand All @@ -499,7 +499,7 @@ $ cargo build
Compiling hello_world v0.1.0 (file:/home/you/projects/hello_world)
src/hello_world.rs:4:39: 4:40 error: use of possibly uninitialized variable: `x`
src/hello_world.rs:4 println!("The value of x is: {}", x);
^
^
note: in expansion of format_args!
<std macros>:2:23: 2:77 note: expansion site
<std macros>:1:1: 3:2 note: in expansion of println!
Expand Down

5 comments on commit 69267b1

@bors
Copy link
Contributor

@bors bors commented on 69267b1 Aug 2, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bors
Copy link
Contributor

@bors bors commented on 69267b1 Aug 2, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging EduardoBautista/rust/fix-guessing-game-appearing-early = 69267b1 into auto

@bors
Copy link
Contributor

@bors bors commented on 69267b1 Aug 2, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

EduardoBautista/rust/fix-guessing-game-appearing-early = 69267b1 merged ok, testing candidate = 5bad333

@bors
Copy link
Contributor

@bors bors commented on 69267b1 Aug 2, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fast-forwarding master to auto = 5bad333

Please sign in to comment.