mirror of https://github.com/sunface/rust-course
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
608 B
21 lines
608 B
3 years ago
|
$ 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: make this binding mutable: `mut x`
|
||
|
3 | println!("The value of x is: {}", x);
|
||
|
4 | x = 6;
|
||
|
| ^^^^^ cannot assign twice to immutable variable
|
||
|
|
||
|
error: aborting due to previous error
|
||
|
|
||
|
For more information about this error, try `rustc --explain E0384`.
|
||
|
error: could not compile `variables`
|
||
|
|
||
|
To learn more, run the command again with --verbose.
|