mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-02 13:07:37 +00:00
16 lines
198 B
Rust
16 lines
198 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() {}
|