Sign in
android
/
toolchain
/
rustc
/
refs/heads/main
/
.
/
tests
/
ui
/
union
/
union-lint-dead-code.rs
blob: cb2cdd4dba008e5467191219c3fad87465cb9475 [
file
] [
log
] [
blame
] [
edit
]
#![
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
});
}