fork/rust

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

borsAuto merge of #71365 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum4fb7144ed15

1.43.0
1.9 KiB58 linesraw
1error[E0384]: cannot assign twice to immutable variable `x`
2  --> $DIR/borrowck-match-binding-is-assignment.rs:14:13
3   |
4LL |         x => {
5   |         -
6   |         |
7   |         first assignment to `x`
8   |         help: make this binding mutable: `mut x`
9LL |             x += 1;
10   |             ^^^^^^ cannot assign twice to immutable variable
11
12error[E0384]: cannot assign twice to immutable variable `x`
13  --> $DIR/borrowck-match-binding-is-assignment.rs:20:13
14   |
15LL |         E::Foo(x) => {
16   |                -
17   |                |
18   |                first assignment to `x`
19   |                help: make this binding mutable: `mut x`
20LL |             x += 1;
21   |             ^^^^^^ cannot assign twice to immutable variable
22
23error[E0384]: cannot assign twice to immutable variable `x`
24  --> $DIR/borrowck-match-binding-is-assignment.rs:26:13
25   |
26LL |         S { bar: x } => {
27   |                  -
28   |                  |
29   |                  first assignment to `x`
30   |                  help: make this binding mutable: `mut x`
31LL |             x += 1;
32   |             ^^^^^^ cannot assign twice to immutable variable
33
34error[E0384]: cannot assign twice to immutable variable `x`
35  --> $DIR/borrowck-match-binding-is-assignment.rs:32:13
36   |
37LL |         (x,) => {
38   |          -
39   |          |
40   |          first assignment to `x`
41   |          help: make this binding mutable: `mut x`
42LL |             x += 1;
43   |             ^^^^^^ cannot assign twice to immutable variable
44
45error[E0384]: cannot assign twice to immutable variable `x`
46  --> $DIR/borrowck-match-binding-is-assignment.rs:38:13
47   |
48LL |         [x,_,_] => {
49   |          -
50   |          |
51   |          first assignment to `x`
52   |          help: make this binding mutable: `mut x`
53LL |             x += 1;
54   |             ^^^^^^ cannot assign twice to immutable variable
55
56error: aborting due to 5 previous errors
57
58For more information about this error, try `rustc --explain E0384`.