fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #72883 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum49cae55760d

1.44.0
1.4 KiB46 linesraw
1error[E0384]: cannot assign twice to immutable variable `x`
2  --> $DIR/liveness-assign-imm-local-notes.rs:10:9
3   |
4LL |     let x;
5   |         - help: make this binding mutable: `mut x`
6...
7LL |         x = 2;
8   |         ----- first assignment to `x`
9LL |         x = 3;
10   |         ^^^^^ cannot assign twice to immutable variable
11
12error[E0384]: cannot assign twice to immutable variable `x`
13  --> $DIR/liveness-assign-imm-local-notes.rs:21:13
14   |
15LL |         let x;
16   |             - help: make this binding mutable: `mut x`
17...
18LL |             x = 2;
19   |             ----- first assignment to `x`
20LL |             x = 3;
21   |             ^^^^^ cannot assign twice to immutable variable
22
23error[E0384]: cannot assign twice to immutable variable `x`
24  --> $DIR/liveness-assign-imm-local-notes.rs:30:13
25   |
26LL |     let x;
27   |         - help: make this binding mutable: `mut x`
28...
29LL |             x = 1;
30   |             ^^^^^ cannot assign twice to immutable variable
31LL |         } else {
32LL |             x = 2;
33   |             ----- first assignment to `x`
34
35error[E0384]: cannot assign twice to immutable variable `x`
36  --> $DIR/liveness-assign-imm-local-notes.rs:32:13
37   |
38LL |     let x;
39   |         - help: make this binding mutable: `mut x`
40...
41LL |             x = 2;
42   |             ^^^^^ cannot assign twice to immutable variable
43
44error: aborting due to 4 previous errors
45
46For more information about this error, try `rustc --explain E0384`.