1 // compile-flags: -Z borrowck=mir
3 // This is the third counter-example from Niko's blog post
4 // smallcultfollowing.com/babysteps/blog/2017/03/01/nested-method-calls-via-two-phase-borrowing/
6 // It shows that not all nested method calls on `self` are magically
7 // allowed by this change. In particular, a nested `&mut` borrow is
13 let mut vec = vec![0, 1];
17 //~^ ERROR cannot borrow `vec` as mutable because it is also borrowed as immutable