10 let z = Z { x: X::Y };
11 let _ = &mut z.x; //~ ERROR cannot borrow
15 fn foo<'z>(&'z self) {
16 let _ = &mut self.x; //~ ERROR cannot borrow
19 fn foo1(&self, other: &Z) {
20 let _ = &mut self.x; //~ ERROR cannot borrow
21 let _ = &mut other.x; //~ ERROR cannot borrow
24 fn foo2<'a>(&'a self, other: &Z) {
25 let _ = &mut self.x; //~ ERROR cannot borrow
26 let _ = &mut other.x; //~ ERROR cannot borrow
29 fn foo3<'a>(self: &'a Self, other: &Z) {
30 let _ = &mut self.x; //~ ERROR cannot borrow
31 let _ = &mut other.x; //~ ERROR cannot borrow
35 let _ = &mut other.x; //~ ERROR cannot borrow
40 pub fn with_arg(z: Z, w: &Z) {
41 let _ = &mut z.x; //~ ERROR cannot borrow
42 let _ = &mut w.x; //~ ERROR cannot borrow
49 //~^ ERROR cannot assign to `*x.0` which is behind a `&` reference