-
Notifications
You must be signed in to change notification settings - Fork 13.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use of unimplemented!() causing ICE with NLL #51345
Comments
Its not only with unimplemented!(): using #![feature(nll)]
fn main() {
let mut v = Vec::new();
loop { v.push(break) }
}
Backtrace:
|
The assertion failure is here: rust/src/librustc_mir/borrow_check/borrow_set.rs Lines 119 to 130 in 860d169
I think that this assertion is just wrong. We add the assertion because -- for 2-phase borrows -- we always generate an activation. But I did not consider the case where the activation is in dead code (as in this case). Unfortunately, we probably can't just delete the assertion. The challenge is that the rust/src/librustc_mir/borrow_check/path_utils.rs Lines 84 to 91 in 860d169
What we probably want to do is to change that field from an enum TwoPhaseActivation {
NotTwoPhase, // what is now `None`
NotActivated,
ActivatedAt(Location), // roughly what is now `Some`
} We could then use the rust/src/librustc_mir/borrow_check/path_utils.rs Lines 87 to 88 in 860d169
|
Use of unimplemented!() causing ICE with NLL Fixes rust-lang#51345. r? @nikomatsakis
Here is a fairly small test case (playground):
The error message is
The text was updated successfully, but these errors were encountered: