mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 07:14:28 +00:00
19 lines
262 B
Rust
19 lines
262 B
Rust
// check-pass
|
|
// revisions: mir thir
|
|
// [thir]compile-flags: -Z thir-unsafeck
|
|
|
|
#[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() {}
|