@@ -2,56 +2,86 @@ error[E0384]: cannot assign twice to immutable variable `x`
22 --> $DIR/borrowck-match-binding-is-assignment.rs:14:13
33 |
44LL | x => {
5- | -
6- | |
7- | first assignment to `x`
8- | help: consider making this binding mutable: `mut x`
5+ | - first assignment to `x`
96LL | x += 1;
107 | ^^^^^^ cannot assign twice to immutable variable
8+ |
9+ help: consider making this binding mutable
10+ |
11+ LL | mut x => {
12+ | ~~~~~
13+ help: to modify the original value, take a borrow instead
14+ |
15+ LL | ref mut x => {
16+ | ~~~~~~~~~
1117
1218error[E0384]: cannot assign twice to immutable variable `x`
1319 --> $DIR/borrowck-match-binding-is-assignment.rs:20:13
1420 |
1521LL | E::Foo(x) => {
16- | -
17- | |
18- | first assignment to `x`
19- | help: consider making this binding mutable: `mut x`
22+ | - first assignment to `x`
2023LL | x += 1;
2124 | ^^^^^^ cannot assign twice to immutable variable
25+ |
26+ help: consider making this binding mutable
27+ |
28+ LL | E::Foo(mut x) => {
29+ | ~~~~~
30+ help: to modify the original value, take a borrow instead
31+ |
32+ LL | E::Foo(ref mut x) => {
33+ | ~~~~~~~~~
2234
2335error[E0384]: cannot assign twice to immutable variable `x`
2436 --> $DIR/borrowck-match-binding-is-assignment.rs:26:13
2537 |
2638LL | S { bar: x } => {
27- | -
28- | |
29- | first assignment to `x`
30- | help: consider making this binding mutable: `mut x`
39+ | - first assignment to `x`
3140LL | x += 1;
3241 | ^^^^^^ cannot assign twice to immutable variable
42+ |
43+ help: consider making this binding mutable
44+ |
45+ LL | S { bar: mut x } => {
46+ | ~~~~~
47+ help: to modify the original value, take a borrow instead
48+ |
49+ LL | S { bar: ref mut x } => {
50+ | ~~~~~~~~~
3351
3452error[E0384]: cannot assign twice to immutable variable `x`
3553 --> $DIR/borrowck-match-binding-is-assignment.rs:32:13
3654 |
3755LL | (x,) => {
38- | -
39- | |
40- | first assignment to `x`
41- | help: consider making this binding mutable: `mut x`
56+ | - first assignment to `x`
4257LL | x += 1;
4358 | ^^^^^^ cannot assign twice to immutable variable
59+ |
60+ help: consider making this binding mutable
61+ |
62+ LL | (mut x,) => {
63+ | ~~~~~
64+ help: to modify the original value, take a borrow instead
65+ |
66+ LL | (ref mut x,) => {
67+ | ~~~~~~~~~
4468
4569error[E0384]: cannot assign twice to immutable variable `x`
4670 --> $DIR/borrowck-match-binding-is-assignment.rs:38:13
4771 |
4872LL | [x,_,_] => {
49- | -
50- | |
51- | first assignment to `x`
52- | help: consider making this binding mutable: `mut x`
73+ | - first assignment to `x`
5374LL | x += 1;
5475 | ^^^^^^ cannot assign twice to immutable variable
76+ |
77+ help: consider making this binding mutable
78+ |
79+ LL | [mut x,_,_] => {
80+ | ~~~~~
81+ help: to modify the original value, take a borrow instead
82+ |
83+ LL | [ref mut x,_,_] => {
84+ | ~~~~~~~~~
5585
5686error: aborting due to 5 previous errors
5787
0 commit comments