-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Closed
Copy link
Labels
A-NLLArea: Non-lexical lifetimes (NLL)Area: Non-lexical lifetimes (NLL)NLL-completeWorking towards the "valid code works" goalWorking towards the "valid code works" goalNLL-diagnosticsWorking towards the "diagnostic parity" goalWorking towards the "diagnostic parity" goalP-highHigh priorityHigh priority
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
}
}
}
Metadata
Metadata
Assignees
Labels
A-NLLArea: Non-lexical lifetimes (NLL)Area: Non-lexical lifetimes (NLL)NLL-completeWorking towards the "valid code works" goalWorking towards the "valid code works" goalNLL-diagnosticsWorking towards the "diagnostic parity" goalWorking towards the "diagnostic parity" goalP-highHigh priorityHigh priority