1 // Test that assignments to an `&mut` pointer which is found in a
2 // borrowed (but otherwise non-aliasable) location is illegal.
8 fn copy_borrowed_ptr<'a,'b>(p: &'a mut S<'b>) -> S<'b> {
9 S { pointer: &mut *p.pointer }
10 //~^ ERROR lifetime may not live long enough
17 let mut y = S { pointer: &mut x };
18 let z = copy_borrowed_ptr(&mut y);