4 // Tests that we detect unsafe places (specifically, union fields and
5 // raw pointer dereferences), even when they're matched on while having
6 // an uninhabited type (equivalent to `std::intrinsics::unreachable()`).
9 union Union { unit: (), void: Void }
10 let u = Union { unit: () };
12 //~^ ERROR access to union field is unsafe
16 let ptr = std::ptr::null::<Void>();
18 //~^ ERROR dereference of raw pointer is unsafe