3 // Test that we point to the correct location that results a union being captured.
4 // Union is special because it can't be disjointly captured.
12 let mut a = A { y: 1 };
14 //~^ `a.y` is borrowed here
15 let _ = unsafe { &a.y };
17 //~^ borrow occurs due to use in closure
18 let _ = unsafe { &mut a.y };
21 //~^ cannot assign to `a.y` because it is borrowed [E0506]
22 //~| `a.y` is assigned to here
24 //~^ borrow later used here