]>
Commit | Line | Data |
---|---|---|
ff7c6d11 | 1 | error[E0596]: cannot borrow field `z.x` of immutable binding as mutable |
32a655c1 SL |
2 | --> $DIR/issue-39544.rs:21:18 |
3 | | | |
0531ce1d | 4 | LL | let z = Z { x: X::Y }; |
cc61c64b | 5 | | - consider changing this to `mut z` |
0531ce1d | 6 | LL | let _ = &mut z.x; //~ ERROR cannot borrow |
ff7c6d11 | 7 | | ^^^ cannot mutably borrow field of immutable binding |
32a655c1 | 8 | |
ff7c6d11 | 9 | error[E0596]: cannot borrow field `self.x` of immutable binding as mutable |
cc61c64b XL |
10 | --> $DIR/issue-39544.rs:26:22 |
11 | | | |
0531ce1d | 12 | LL | fn foo<'z>(&'z self) { |
cc61c64b | 13 | | -------- use `&'z mut self` here to make mutable |
0531ce1d | 14 | LL | let _ = &mut self.x; //~ ERROR cannot borrow |
ff7c6d11 | 15 | | ^^^^^^ cannot mutably borrow field of immutable binding |
cc61c64b | 16 | |
ff7c6d11 | 17 | error[E0596]: cannot borrow field `self.x` of immutable binding as mutable |
cc61c64b XL |
18 | --> $DIR/issue-39544.rs:30:22 |
19 | | | |
0531ce1d | 20 | LL | fn foo1(&self, other: &Z) { |
cc61c64b | 21 | | ----- use `&mut self` here to make mutable |
0531ce1d | 22 | LL | let _ = &mut self.x; //~ ERROR cannot borrow |
ff7c6d11 | 23 | | ^^^^^^ cannot mutably borrow field of immutable binding |
cc61c64b | 24 | |
ff7c6d11 | 25 | error[E0596]: cannot borrow field `other.x` of immutable binding as mutable |
cc61c64b XL |
26 | --> $DIR/issue-39544.rs:31:22 |
27 | | | |
0531ce1d | 28 | LL | fn foo1(&self, other: &Z) { |
cc61c64b | 29 | | -- use `&mut Z` here to make mutable |
0531ce1d XL |
30 | LL | let _ = &mut self.x; //~ ERROR cannot borrow |
31 | LL | let _ = &mut other.x; //~ ERROR cannot borrow | |
ff7c6d11 | 32 | | ^^^^^^^ cannot mutably borrow field of immutable binding |
cc61c64b | 33 | |
ff7c6d11 | 34 | error[E0596]: cannot borrow field `self.x` of immutable binding as mutable |
cc61c64b XL |
35 | --> $DIR/issue-39544.rs:35:22 |
36 | | | |
0531ce1d | 37 | LL | fn foo2<'a>(&'a self, other: &Z) { |
cc61c64b | 38 | | -------- use `&'a mut self` here to make mutable |
0531ce1d | 39 | LL | let _ = &mut self.x; //~ ERROR cannot borrow |
ff7c6d11 | 40 | | ^^^^^^ cannot mutably borrow field of immutable binding |
cc61c64b | 41 | |
ff7c6d11 | 42 | error[E0596]: cannot borrow field `other.x` of immutable binding as mutable |
cc61c64b XL |
43 | --> $DIR/issue-39544.rs:36:22 |
44 | | | |
0531ce1d | 45 | LL | fn foo2<'a>(&'a self, other: &Z) { |
cc61c64b | 46 | | -- use `&mut Z` here to make mutable |
0531ce1d XL |
47 | LL | let _ = &mut self.x; //~ ERROR cannot borrow |
48 | LL | let _ = &mut other.x; //~ ERROR cannot borrow | |
ff7c6d11 | 49 | | ^^^^^^^ cannot mutably borrow field of immutable binding |
cc61c64b | 50 | |
ff7c6d11 | 51 | error[E0596]: cannot borrow field `self.x` of immutable binding as mutable |
cc61c64b XL |
52 | --> $DIR/issue-39544.rs:40:22 |
53 | | | |
0531ce1d | 54 | LL | fn foo3<'a>(self: &'a Self, other: &Z) { |
cc61c64b | 55 | | -------- use `&'a mut Self` here to make mutable |
0531ce1d | 56 | LL | let _ = &mut self.x; //~ ERROR cannot borrow |
ff7c6d11 | 57 | | ^^^^^^ cannot mutably borrow field of immutable binding |
cc61c64b | 58 | |
ff7c6d11 | 59 | error[E0596]: cannot borrow field `other.x` of immutable binding as mutable |
cc61c64b XL |
60 | --> $DIR/issue-39544.rs:41:22 |
61 | | | |
0531ce1d | 62 | LL | fn foo3<'a>(self: &'a Self, other: &Z) { |
cc61c64b | 63 | | -- use `&mut Z` here to make mutable |
0531ce1d XL |
64 | LL | let _ = &mut self.x; //~ ERROR cannot borrow |
65 | LL | let _ = &mut other.x; //~ ERROR cannot borrow | |
ff7c6d11 | 66 | | ^^^^^^^ cannot mutably borrow field of immutable binding |
cc61c64b | 67 | |
ff7c6d11 | 68 | error[E0596]: cannot borrow field `other.x` of immutable binding as mutable |
cc61c64b XL |
69 | --> $DIR/issue-39544.rs:45:22 |
70 | | | |
0531ce1d | 71 | LL | fn foo4(other: &Z) { |
cc61c64b | 72 | | -- use `&mut Z` here to make mutable |
0531ce1d | 73 | LL | let _ = &mut other.x; //~ ERROR cannot borrow |
ff7c6d11 | 74 | | ^^^^^^^ cannot mutably borrow field of immutable binding |
cc61c64b | 75 | |
ff7c6d11 | 76 | error[E0596]: cannot borrow field `z.x` of immutable binding as mutable |
cc61c64b XL |
77 | --> $DIR/issue-39544.rs:51:18 |
78 | | | |
0531ce1d | 79 | LL | pub fn with_arg(z: Z, w: &Z) { |
cc61c64b | 80 | | - consider changing this to `mut z` |
0531ce1d | 81 | LL | let _ = &mut z.x; //~ ERROR cannot borrow |
ff7c6d11 | 82 | | ^^^ cannot mutably borrow field of immutable binding |
cc61c64b | 83 | |
ff7c6d11 | 84 | error[E0596]: cannot borrow field `w.x` of immutable binding as mutable |
cc61c64b XL |
85 | --> $DIR/issue-39544.rs:52:18 |
86 | | | |
0531ce1d | 87 | LL | pub fn with_arg(z: Z, w: &Z) { |
cc61c64b | 88 | | -- use `&mut Z` here to make mutable |
0531ce1d XL |
89 | LL | let _ = &mut z.x; //~ ERROR cannot borrow |
90 | LL | let _ = &mut w.x; //~ ERROR cannot borrow | |
ff7c6d11 | 91 | | ^^^ cannot mutably borrow field of immutable binding |
cc61c64b | 92 | |
ff7c6d11 | 93 | error[E0594]: cannot assign to borrowed content `*x.0` of immutable binding |
cc61c64b XL |
94 | --> $DIR/issue-39544.rs:58:5 |
95 | | | |
0531ce1d | 96 | LL | *x.0 = 1; |
cc61c64b XL |
97 | | ^^^^^^^^ cannot borrow as mutable |
98 | ||
041b39d2 | 99 | error: aborting due to 12 previous errors |
32a655c1 | 100 | |
0531ce1d XL |
101 | Some errors occurred: E0594, E0596. |
102 | For more information about an error, try `rustc --explain E0594`. |