]>
Commit | Line | Data |
---|---|---|
136023e0 XL |
1 | // revisions: mirunsafeck thirunsafeck |
2 | // [thirunsafeck]compile-flags: -Z thir-unsafeck | |
3 | ||
9e0c209e SL |
4 | #![deny(dead_code)] |
5 | ||
6 | union Foo { | |
7 | x: usize, | |
923072b8 | 8 | b: bool, //~ ERROR: field `b` is never read |
9e0c209e SL |
9 | _unused: u16, |
10 | } | |
11 | ||
12 | fn field_read(f: Foo) -> usize { | |
13 | unsafe { f.x } | |
54a0048b | 14 | } |
223e47cc | 15 | |
970d7e83 | 16 | fn main() { |
9e0c209e | 17 | let _ = field_read(Foo { x: 2 }); |
223e47cc | 18 | } |