@@ -2,56 +2,86 @@ error[E0384]: cannot assign twice to immutable variable `x`
2
2
--> $DIR/borrowck-match-binding-is-assignment.rs:14:13
3
3
|
4
4
LL | x => {
5
- | -
6
- | |
7
- | first assignment to `x`
8
- | help: consider making this binding mutable: `mut x`
5
+ | - first assignment to `x`
9
6
LL | x += 1;
10
7
| ^^^^^^ 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
+ | ~~~~~~~~~
11
17
12
18
error[E0384]: cannot assign twice to immutable variable `x`
13
19
--> $DIR/borrowck-match-binding-is-assignment.rs:20:13
14
20
|
15
21
LL | E::Foo(x) => {
16
- | -
17
- | |
18
- | first assignment to `x`
19
- | help: consider making this binding mutable: `mut x`
22
+ | - first assignment to `x`
20
23
LL | x += 1;
21
24
| ^^^^^^ 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
+ | ~~~~~~~~~
22
34
23
35
error[E0384]: cannot assign twice to immutable variable `x`
24
36
--> $DIR/borrowck-match-binding-is-assignment.rs:26:13
25
37
|
26
38
LL | S { bar: x } => {
27
- | -
28
- | |
29
- | first assignment to `x`
30
- | help: consider making this binding mutable: `mut x`
39
+ | - first assignment to `x`
31
40
LL | x += 1;
32
41
| ^^^^^^ 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
+ | ~~~~~~~~~
33
51
34
52
error[E0384]: cannot assign twice to immutable variable `x`
35
53
--> $DIR/borrowck-match-binding-is-assignment.rs:32:13
36
54
|
37
55
LL | (x,) => {
38
- | -
39
- | |
40
- | first assignment to `x`
41
- | help: consider making this binding mutable: `mut x`
56
+ | - first assignment to `x`
42
57
LL | x += 1;
43
58
| ^^^^^^ 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
+ | ~~~~~~~~~
44
68
45
69
error[E0384]: cannot assign twice to immutable variable `x`
46
70
--> $DIR/borrowck-match-binding-is-assignment.rs:38:13
47
71
|
48
72
LL | [x,_,_] => {
49
- | -
50
- | |
51
- | first assignment to `x`
52
- | help: consider making this binding mutable: `mut x`
73
+ | - first assignment to `x`
53
74
LL | x += 1;
54
75
| ^^^^^^ 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
+ | ~~~~~~~~~
55
85
56
86
error: aborting due to 5 previous errors
57
87
0 commit comments