Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
29 lines (24 sloc) 435 Bytes
// build-pass (FIXME(62277): could be check-pass?)
#![feature(untagged_unions)]
struct A;
struct B;
union U {
a: A,
b: B,
}
fn main() {
unsafe {
{
let mut u = U { a: A };
let a = u.a;
u.a = A;
let a = u.a; // OK
}
{
let mut u = U { a: A };
let a = u.a;
u.b = B;
let a = u.a; // OK
}
}
}
You can’t perform that action at this time.