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