]>
git.proxmox.com Git - rustc.git/blob - src/test/ui/closures/2229_closure_analysis/diagnostics/union.rs
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 //~^ borrow of `a.y` occurs 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 //~| assignment to borrowed `a.y` occurs here
24 //~^ borrow later used here