Sign in
android
/
toolchain
/
rustc
/
54272acac043c1dedfb7db7420545b31ec1ac51f
/
.
/
src
/
test
/
ui
/
union
/
union-inherent-method.rs
blob: b0fd22da73adc146c203e8aa687a667b2753fe70 [
file
] [
log
] [
blame
]
// run-pass
// revisions: mirunsafeck thirunsafeck
// [thirunsafeck]compile-flags: -Z thir-unsafeck
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
);
}