mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-02 03:33:59 +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 });
|
|
}
|