]> git.proxmox.com Git - rustc.git/blob - src/test/ui/unsafe/access_union_field.rs
Update unsuspicious file list
[rustc.git] / src / test / ui / unsafe / access_union_field.rs
1 // revisions: mir thir
2 // [thir]compile-flags: -Z thir-unsafeck
3
4 #![allow(unused_variables)]
5
6 union Foo {
7 bar: i8,
8 baz: u8,
9 }
10
11 fn main() {
12 let foo = Foo { bar: 5 };
13 let a = foo.bar; //~ ERROR access to union field is unsafe and requires unsafe function or block
14 let b = foo.baz; //~ ERROR access to union field is unsafe and requires unsafe function or block
15 }