Closed
Description
@pnkfelix's review comments:
ui/borrowck/borrowck-union-move-assign.nll.stderr rejecting sound uses of unions; it reports 3 errors when only one expected. We should make a run-pass test from the two cases we expect to accept.
For the record, here's the relevant part of the test in question (play):
#![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
}
}
}