]> git.lizzy.rs Git - rust.git/blob - src/test/ui/unsafe/union_access_through_block.rs
Rollup merge of #100861 - RalfJung:const-ice, r=oli-obk
[rust.git] / src / test / ui / unsafe / union_access_through_block.rs
1 // check-pass
2 // revisions: mir thir
3 // [thir]compile-flags: -Z thir-unsafeck
4
5 #[derive(Copy, Clone)]
6 pub struct Foo { a: bool }
7
8 pub union Bar {
9     a: Foo,
10     b: u32,
11 }
12 pub fn baz(mut bar: Bar) {
13     unsafe {
14         { bar.a }.a = true;
15     }
16 }
17
18 fn main() {}