mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-12 08:36:03 +00:00
982b49494e
This is to make the diff when stabilizing it easier to review.
16 lines
223 B
Rust
16 lines
223 B
Rust
#![deny(dead_code)]
|
|
|
|
union Foo {
|
|
x: usize,
|
|
b: bool, //~ ERROR: field `b` is never read
|
|
_unused: u16,
|
|
}
|
|
|
|
fn field_read(f: Foo) -> usize {
|
|
unsafe { f.x }
|
|
}
|
|
|
|
fn main() {
|
|
let _ = field_read(Foo { x: 2 });
|
|
}
|