Sign in
◑
Theme
rust
/
rust
/
0ae3fd93a3a91460c1957fa38fa9514decbcdf23
/
.
/
tests
/
ui
/
union
/
union-inherent-method.rs
blob: 86a62ff18cd3d75c841f9c0b831b6595da43c1c4 [
file
]
//@ run-pass
//@ reference: items.impl.inherent.associated-items.allowed-items
union U
{
a
:
u8
,
}
impl
U
{
fn
method
(&
self
)
->
u8
{
unsafe
{
self
.
a
}
}
}
fn
main
()
{
let
u
=
U
{
a
:
10
};
assert_eq
!(
u
.
method
(),
10
);
}