trpl-zh-cn/listings/ch03-common-programming-concepts/no-listing-01-variables-are-immutable/output.txt
Sefank 7090f728ec
Update listing code in ch03
Signed-off-by: Sefank <12670778+Sefank@users.noreply.github.com>
2022-07-04 10:48:13 +08:00

17 lines
546 B
Plaintext
Executable File

$ cargo run
Compiling variables v0.1.0 (file:///projects/variables)
error[E0384]: cannot assign twice to immutable variable `x`
--> src/main.rs:4:5
|
2 | let x = 5;
| -
| |
| first assignment to `x`
| help: consider making this binding mutable: `mut x`
3 | println!("The value of x is: {x}");
4 | x = 6;
| ^^^^^ cannot assign twice to immutable variable
For more information about this error, try `rustc --explain E0384`.
error: could not compile `variables` due to previous error