rust/tests/ui/unsafe/union_access_through_block.rs
Matthew Jasper 982b49494e Remove revisions for THIR unsafeck
This is to make the diff when stabilizing it easier to review.
2024-01-05 09:30:27 +00:00

16 lines
197 B
Rust

// check-pass
#[derive(Copy, Clone)]
pub struct Foo { a: bool }
pub union Bar {
a: Foo,
b: u32,
}
pub fn baz(mut bar: Bar) {
unsafe {
{ bar.a }.a = true;
}
}
fn main() {}