2018-08-08 14:28:26 +02:00
|
|
|
error[E0384]: cannot assign twice to immutable variable `v`
|
2019-04-22 08:40:08 +01:00
|
|
|
--> $DIR/assign-imm-local-twice.rs:7:5
|
2018-08-08 14:28:26 +02:00
|
|
|
|
|
2019-03-17 10:52:07 +01:00
|
|
|
LL | v = 1;
|
2018-08-08 14:28:26 +02:00
|
|
|
| ----- first assignment to `v`
|
2019-04-22 08:40:08 +01:00
|
|
|
LL | println!("v={}", v);
|
2019-03-17 10:52:07 +01:00
|
|
|
LL | v = 2;
|
2018-08-08 14:28:26 +02:00
|
|
|
| ^^^^^ cannot assign twice to immutable variable
|
2024-07-03 21:01:29 +00:00
|
|
|
|
|
|
|
|
help: consider making this binding mutable
|
|
|
|
|
|
|
|
|
LL | let mut v: isize;
|
|
|
|
| +++
|
2018-08-08 14:28:26 +02:00
|
|
|
|
2023-11-21 15:44:16 +00:00
|
|
|
error: aborting due to 1 previous error
|
2018-08-08 14:28:26 +02:00
|
|
|
|
|
|
|
For more information about this error, try `rustc --explain E0384`.
|