1 // Test that attempt to swap `&mut` pointer while pointee is borrowed
4 // Example from compiler/rustc_borrowck/borrowck/README.md
10 fn foo<'a>(mut t0: &'a mut isize,
11 mut t1: &'a mut isize) {
12 let p: &isize = &*t0; // Freezes `*t0`
13 swap(&mut t0, &mut t1); //~ ERROR cannot borrow `t0`
21 trait Fake { fn use_mut(&mut self) { } fn use_ref(&self) { } }
22 impl<T> Fake for T { }