1 struct Point { x: isize, y: isize }
5 fn blockm<F>(&self, f: F) where F: FnOnce();
8 impl Methods for Point {
12 fn blockm<F>(&self, f: F) where F: FnOnce() { f() }
16 let mut p = Point {x: 3, y: 4};
18 // Here: it's ok to call even though receiver is mutable, because we
22 // But in this case we do not honor the loan:
23 p.blockm(|| { //~ ERROR cannot borrow `p` as mutable
29 let mut p = Point {x: 3, y: 4};
31 // Here I create an outstanding loan and check that we get conflicts:
34 p.impurem(); //~ ERROR cannot borrow