1 // Test that borrows that occur due to calls to object methods
2 // properly "claim" the object path.
7 fn borrowed(&self) -> &();
8 fn mut_borrowed(&mut self) -> &();
11 fn borrowed_receiver(x: &dyn Foo) {
18 fn mut_borrowed_receiver(x: &mut dyn Foo) {
20 let z = x.mut_borrowed(); //~ ERROR cannot borrow
24 fn mut_owned_receiver(mut x: Box<dyn Foo>) {
26 let z = &mut x; //~ ERROR cannot borrow
30 fn imm_owned_receiver(mut x: Box<dyn Foo>) {
39 trait Fake { fn use_mut(&mut self) { } fn use_ref(&self) { } }
40 impl<T> Fake for T { }