1 //! Reborrowing a `&mut !Unpin` must still act like a (fake) read.
2 use std::marker::PhantomPinned;
4 struct NotUnpin(i32, PhantomPinned);
8 let mut x = NotUnpin(0, PhantomPinned);
9 // Mutable borrow of `Unpin` field (with lifetime laundering)
10 let fieldref = &mut *(&mut x.0 as *mut i32);
11 // Mutable reborrow of the entire `x`, which is `!Unpin` but should
12 // still count as a read since we would add `dereferenceable`.
14 // That read should have invalidated `fieldref`.
15 *fieldref = 0; //~ ERROR: /write access .* tag does not exist in the borrow stack/