1
- error: cannot borrow immutable field `z.x` as mutable
1
+ error[E0596] : cannot borrow immutable field `z.x` as mutable
2
2
--> $DIR/issue-39544.rs:21:18
3
3
|
4
4
20 | let z = Z { x: X::Y };
5
5
| - consider changing this to `mut z`
6
6
21 | let _ = &mut z.x;
7
7
| ^^^ cannot mutably borrow immutable field
8
8
9
- error: cannot borrow immutable field `self.x` as mutable
9
+ error[E0596] : cannot borrow immutable field `self.x` as mutable
10
10
--> $DIR/issue-39544.rs:26:22
11
11
|
12
12
25 | fn foo<'z>(&'z self) {
13
13
| -------- use `&'z mut self` here to make mutable
14
14
26 | let _ = &mut self.x;
15
15
| ^^^^^^ cannot mutably borrow immutable field
16
16
17
- error: cannot borrow immutable field `self.x` as mutable
17
+ error[E0596] : cannot borrow immutable field `self.x` as mutable
18
18
--> $DIR/issue-39544.rs:30:22
19
19
|
20
20
29 | fn foo1(&self, other: &Z) {
21
21
| ----- use `&mut self` here to make mutable
22
22
30 | let _ = &mut self.x;
23
23
| ^^^^^^ cannot mutably borrow immutable field
24
24
25
- error: cannot borrow immutable field `other.x` as mutable
25
+ error[E0596] : cannot borrow immutable field `other.x` as mutable
26
26
--> $DIR/issue-39544.rs:31:22
27
27
|
28
28
29 | fn foo1(&self, other: &Z) {
@@ -31,15 +31,15 @@ error: cannot borrow immutable field `other.x` as mutable
31
31
31 | let _ = &mut other.x;
32
32
| ^^^^^^^ cannot mutably borrow immutable field
33
33
34
- error: cannot borrow immutable field `self.x` as mutable
34
+ error[E0596] : cannot borrow immutable field `self.x` as mutable
35
35
--> $DIR/issue-39544.rs:35:22
36
36
|
37
37
34 | fn foo2<'a>(&'a self, other: &Z) {
38
38
| -------- use `&'a mut self` here to make mutable
39
39
35 | let _ = &mut self.x;
40
40
| ^^^^^^ cannot mutably borrow immutable field
41
41
42
- error: cannot borrow immutable field `other.x` as mutable
42
+ error[E0596] : cannot borrow immutable field `other.x` as mutable
43
43
--> $DIR/issue-39544.rs:36:22
44
44
|
45
45
34 | fn foo2<'a>(&'a self, other: &Z) {
@@ -48,15 +48,15 @@ error: cannot borrow immutable field `other.x` as mutable
48
48
36 | let _ = &mut other.x;
49
49
| ^^^^^^^ cannot mutably borrow immutable field
50
50
51
- error: cannot borrow immutable field `self.x` as mutable
51
+ error[E0596] : cannot borrow immutable field `self.x` as mutable
52
52
--> $DIR/issue-39544.rs:40:22
53
53
|
54
54
39 | fn foo3<'a>(self: &'a Self, other: &Z) {
55
55
| -------- use `&'a mut Self` here to make mutable
56
56
40 | let _ = &mut self.x;
57
57
| ^^^^^^ cannot mutably borrow immutable field
58
58
59
- error: cannot borrow immutable field `other.x` as mutable
59
+ error[E0596] : cannot borrow immutable field `other.x` as mutable
60
60
--> $DIR/issue-39544.rs:41:22
61
61
|
62
62
39 | fn foo3<'a>(self: &'a Self, other: &Z) {
@@ -65,23 +65,23 @@ error: cannot borrow immutable field `other.x` as mutable
65
65
41 | let _ = &mut other.x;
66
66
| ^^^^^^^ cannot mutably borrow immutable field
67
67
68
- error: cannot borrow immutable field `other.x` as mutable
68
+ error[E0596] : cannot borrow immutable field `other.x` as mutable
69
69
--> $DIR/issue-39544.rs:45:22
70
70
|
71
71
44 | fn foo4(other: &Z) {
72
72
| -- use `&mut Z` here to make mutable
73
73
45 | let _ = &mut other.x;
74
74
| ^^^^^^^ cannot mutably borrow immutable field
75
75
76
- error: cannot borrow immutable field `z.x` as mutable
76
+ error[E0596] : cannot borrow immutable field `z.x` as mutable
77
77
--> $DIR/issue-39544.rs:51:18
78
78
|
79
79
50 | pub fn with_arg(z: Z, w: &Z) {
80
80
| - consider changing this to `mut z`
81
81
51 | let _ = &mut z.x;
82
82
| ^^^ cannot mutably borrow immutable field
83
83
84
- error: cannot borrow immutable field `w.x` as mutable
84
+ error[E0596] : cannot borrow immutable field `w.x` as mutable
85
85
--> $DIR/issue-39544.rs:52:18
86
86
|
87
87
50 | pub fn with_arg(z: Z, w: &Z) {
@@ -90,7 +90,7 @@ error: cannot borrow immutable field `w.x` as mutable
90
90
52 | let _ = &mut w.x;
91
91
| ^^^ cannot mutably borrow immutable field
92
92
93
- error: cannot assign to immutable borrowed content `*x.0`
93
+ error[E0594] : cannot assign to immutable borrowed content `*x.0`
94
94
--> $DIR/issue-39544.rs:58:5
95
95
|
96
96
58 | *x.0 = 1;
0 commit comments