|
1 |
| -error[E0596]: cannot borrow immutable field `z.x` as mutable |
| 1 | +error[E0596]: cannot borrow field `z.x` of immutable binding 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; //~ ERROR cannot borrow
|
7 |
| - | ^^^ cannot mutably borrow immutable field |
| 7 | + | ^^^ cannot mutably borrow field of immutable binding |
8 | 8 |
|
9 |
| -error[E0596]: cannot borrow immutable field `self.x` as mutable |
| 9 | +error[E0596]: cannot borrow field `self.x` of immutable binding 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; //~ ERROR cannot borrow
|
15 |
| - | ^^^^^^ cannot mutably borrow immutable field |
| 15 | + | ^^^^^^ cannot mutably borrow field of immutable binding |
16 | 16 |
|
17 |
| -error[E0596]: cannot borrow immutable field `self.x` as mutable |
| 17 | +error[E0596]: cannot borrow field `self.x` of immutable binding 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; //~ ERROR cannot borrow
|
23 |
| - | ^^^^^^ cannot mutably borrow immutable field |
| 23 | + | ^^^^^^ cannot mutably borrow field of immutable binding |
24 | 24 |
|
25 |
| -error[E0596]: cannot borrow immutable field `other.x` as mutable |
| 25 | +error[E0596]: cannot borrow field `other.x` of immutable binding as mutable |
26 | 26 | --> $DIR/issue-39544.rs:31:22
|
27 | 27 | |
|
28 | 28 | 29 | fn foo1(&self, other: &Z) {
|
29 | 29 | | -- use `&mut Z` here to make mutable
|
30 | 30 | 30 | let _ = &mut self.x; //~ ERROR cannot borrow
|
31 | 31 | 31 | let _ = &mut other.x; //~ ERROR cannot borrow
|
32 |
| - | ^^^^^^^ cannot mutably borrow immutable field |
| 32 | + | ^^^^^^^ cannot mutably borrow field of immutable binding |
33 | 33 |
|
34 |
| -error[E0596]: cannot borrow immutable field `self.x` as mutable |
| 34 | +error[E0596]: cannot borrow field `self.x` of immutable binding 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; //~ ERROR cannot borrow
|
40 |
| - | ^^^^^^ cannot mutably borrow immutable field |
| 40 | + | ^^^^^^ cannot mutably borrow field of immutable binding |
41 | 41 |
|
42 |
| -error[E0596]: cannot borrow immutable field `other.x` as mutable |
| 42 | +error[E0596]: cannot borrow field `other.x` of immutable binding as mutable |
43 | 43 | --> $DIR/issue-39544.rs:36:22
|
44 | 44 | |
|
45 | 45 | 34 | fn foo2<'a>(&'a self, other: &Z) {
|
46 | 46 | | -- use `&mut Z` here to make mutable
|
47 | 47 | 35 | let _ = &mut self.x; //~ ERROR cannot borrow
|
48 | 48 | 36 | let _ = &mut other.x; //~ ERROR cannot borrow
|
49 |
| - | ^^^^^^^ cannot mutably borrow immutable field |
| 49 | + | ^^^^^^^ cannot mutably borrow field of immutable binding |
50 | 50 |
|
51 |
| -error[E0596]: cannot borrow immutable field `self.x` as mutable |
| 51 | +error[E0596]: cannot borrow field `self.x` of immutable binding 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; //~ ERROR cannot borrow
|
57 |
| - | ^^^^^^ cannot mutably borrow immutable field |
| 57 | + | ^^^^^^ cannot mutably borrow field of immutable binding |
58 | 58 |
|
59 |
| -error[E0596]: cannot borrow immutable field `other.x` as mutable |
| 59 | +error[E0596]: cannot borrow field `other.x` of immutable binding as mutable |
60 | 60 | --> $DIR/issue-39544.rs:41:22
|
61 | 61 | |
|
62 | 62 | 39 | fn foo3<'a>(self: &'a Self, other: &Z) {
|
63 | 63 | | -- use `&mut Z` here to make mutable
|
64 | 64 | 40 | let _ = &mut self.x; //~ ERROR cannot borrow
|
65 | 65 | 41 | let _ = &mut other.x; //~ ERROR cannot borrow
|
66 |
| - | ^^^^^^^ cannot mutably borrow immutable field |
| 66 | + | ^^^^^^^ cannot mutably borrow field of immutable binding |
67 | 67 |
|
68 |
| -error[E0596]: cannot borrow immutable field `other.x` as mutable |
| 68 | +error[E0596]: cannot borrow field `other.x` of immutable binding 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; //~ ERROR cannot borrow
|
74 |
| - | ^^^^^^^ cannot mutably borrow immutable field |
| 74 | + | ^^^^^^^ cannot mutably borrow field of immutable binding |
75 | 75 |
|
76 |
| -error[E0596]: cannot borrow immutable field `z.x` as mutable |
| 76 | +error[E0596]: cannot borrow field `z.x` of immutable binding 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; //~ ERROR cannot borrow
|
82 |
| - | ^^^ cannot mutably borrow immutable field |
| 82 | + | ^^^ cannot mutably borrow field of immutable binding |
83 | 83 |
|
84 |
| -error[E0596]: cannot borrow immutable field `w.x` as mutable |
| 84 | +error[E0596]: cannot borrow field `w.x` of immutable binding as mutable |
85 | 85 | --> $DIR/issue-39544.rs:52:18
|
86 | 86 | |
|
87 | 87 | 50 | pub fn with_arg(z: Z, w: &Z) {
|
88 | 88 | | -- use `&mut Z` here to make mutable
|
89 | 89 | 51 | let _ = &mut z.x; //~ ERROR cannot borrow
|
90 | 90 | 52 | let _ = &mut w.x; //~ ERROR cannot borrow
|
91 |
| - | ^^^ cannot mutably borrow immutable field |
| 91 | + | ^^^ cannot mutably borrow field of immutable binding |
92 | 92 |
|
93 |
| -error[E0594]: cannot assign to immutable borrowed content `*x.0` |
| 93 | +error[E0594]: cannot assign to borrowed content `*x.0` of immutable binding |
94 | 94 | --> $DIR/issue-39544.rs:58:5
|
95 | 95 | |
|
96 |
| -58 | *x.0 = 1; //~ ERROR cannot assign to immutable borrowed content |
| 96 | +58 | *x.0 = 1; |
97 | 97 | | ^^^^^^^^ cannot borrow as mutable
|
98 | 98 |
|
99 | 99 | error: aborting due to 12 previous errors
|
|
0 commit comments