//~^ mutable borrow occurs here
let z = &x; //~ ERROR cannot borrow
//~^ immutable borrow occurs here
+ z.use_ref();
+ y.use_mut();
}
fn foo() {
//~^ immutable borrow occurs here
let z = &mut x; //~ ERROR cannot borrow
//~^ mutable borrow occurs here
+ z.use_mut();
+ y.use_ref();
}
false => ()
}
//~^ first mutable borrow occurs here
let z = &mut x; //~ ERROR cannot borrow
//~^ second mutable borrow occurs here
+ z.use_mut();
+ y.use_mut();
};
}
+
+trait Fake { fn use_mut(&mut self) { } fn use_ref(&self) { } }
+impl<T> Fake for T { }