fork/rust
git clone https://git.julia.blue/fork/rust
3bcad65fbf6
master
1error[E0596]: cannot borrow `z.x` as mutable, as `z` is not declared as mutable 2 --> $DIR/issue-39544.rs:11:13 3 | 4LL | let _ = &mut z.x; 5 | ^^^^^^^^ cannot borrow as mutable 6 | 7help: consider changing this to be mutable 8 | 9LL | let mut z = Z { x: X::Y }; 10 | +++ 11 12error[E0596]: cannot borrow `self.x` as mutable, as it is behind a `&` reference 13 --> $DIR/issue-39544.rs:16:17 14 | 15LL | let _ = &mut self.x; 16 | ^^^^^^^^^^^ `self` is a `&` reference, so the data it refers to cannot be borrowed as mutable 17 | 18help: consider changing this to be a mutable reference 19 | 20LL | fn foo<'z>(&'z mut self) { 21 | ~~~~~~~~~~~~ 22 23error[E0596]: cannot borrow `self.x` as mutable, as it is behind a `&` reference 24 --> $DIR/issue-39544.rs:20:17 25 | 26LL | let _ = &mut self.x; 27 | ^^^^^^^^^^^ `self` is a `&` reference, so the data it refers to cannot be borrowed as mutable 28 | 29help: consider changing this to be a mutable reference 30 | 31LL | fn foo1(&mut self, other: &Z) { 32 | ~~~~~~~~~ 33 34error[E0596]: cannot borrow `other.x` as mutable, as it is behind a `&` reference 35 --> $DIR/issue-39544.rs:21:17 36 | 37LL | let _ = &mut other.x; 38 | ^^^^^^^^^^^^ `other` is a `&` reference, so the data it refers to cannot be borrowed as mutable 39 | 40help: consider changing this to be a mutable reference 41 | 42LL | fn foo1(&self, other: &mut Z) { 43 | +++ 44 45error[E0596]: cannot borrow `self.x` as mutable, as it is behind a `&` reference 46 --> $DIR/issue-39544.rs:25:17 47 | 48LL | let _ = &mut self.x; 49 | ^^^^^^^^^^^ `self` is a `&` reference, so the data it refers to cannot be borrowed as mutable 50 | 51help: consider changing this to be a mutable reference 52 | 53LL | fn foo2<'a>(&'a mut self, other: &Z) { 54 | ~~~~~~~~~~~~ 55 56error[E0596]: cannot borrow `other.x` as mutable, as it is behind a `&` reference 57 --> $DIR/issue-39544.rs:26:17 58 | 59LL | let _ = &mut other.x; 60 | ^^^^^^^^^^^^ `other` is a `&` reference, so the data it refers to cannot be borrowed as mutable 61 | 62help: consider changing this to be a mutable reference 63 | 64LL | fn foo2<'a>(&'a self, other: &mut Z) { 65 | +++ 66 67error[E0596]: cannot borrow `self.x` as mutable, as it is behind a `&` reference 68 --> $DIR/issue-39544.rs:30:17 69 | 70LL | let _ = &mut self.x; 71 | ^^^^^^^^^^^ `self` is a `&` reference, so the data it refers to cannot be borrowed as mutable 72 | 73help: consider changing this to be a mutable reference 74 | 75LL | fn foo3<'a>(self: &'a mut Self, other: &Z) { 76 | +++ 77 78error[E0596]: cannot borrow `other.x` as mutable, as it is behind a `&` reference 79 --> $DIR/issue-39544.rs:31:17 80 | 81LL | let _ = &mut other.x; 82 | ^^^^^^^^^^^^ `other` is a `&` reference, so the data it refers to cannot be borrowed as mutable 83 | 84help: consider changing this to be a mutable reference 85 | 86LL | fn foo3<'a>(self: &'a Self, other: &mut Z) { 87 | +++ 88 89error[E0596]: cannot borrow `other.x` as mutable, as it is behind a `&` reference 90 --> $DIR/issue-39544.rs:35:17 91 | 92LL | let _ = &mut other.x; 93 | ^^^^^^^^^^^^ `other` is a `&` reference, so the data it refers to cannot be borrowed as mutable 94 | 95help: consider changing this to be a mutable reference 96 | 97LL | fn foo4(other: &mut Z) { 98 | +++ 99 100error[E0596]: cannot borrow `z.x` as mutable, as `z` is not declared as mutable 101 --> $DIR/issue-39544.rs:41:13 102 | 103LL | let _ = &mut z.x; 104 | ^^^^^^^^ cannot borrow as mutable 105 | 106help: consider changing this to be mutable 107 | 108LL | pub fn with_arg(mut z: Z, w: &Z) { 109 | +++ 110 111error[E0596]: cannot borrow `w.x` as mutable, as it is behind a `&` reference 112 --> $DIR/issue-39544.rs:42:13 113 | 114LL | let _ = &mut w.x; 115 | ^^^^^^^^ `w` is a `&` reference, so the data it refers to cannot be borrowed as mutable 116 | 117help: consider changing this to be a mutable reference 118 | 119LL | pub fn with_arg(z: Z, w: &mut Z) { 120 | +++ 121 122error[E0594]: cannot assign to `*x.0`, which is behind a `&` reference 123 --> $DIR/issue-39544.rs:48:5 124 | 125LL | *x.0 = 1; 126 | ^^^^^^^^ cannot assign 127 128error: aborting due to 12 previous errors 129 130Some errors have detailed explanations: E0594, E0596. 131For more information about an error, try `rustc --explain E0594`.