Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upUse of unimplemented!() causing ICE with NLL #51345
Comments
csmoe
added
A-diagnostics
I-ICE
A-NLL
labels
Jun 4, 2018
This comment has been minimized.
This comment has been minimized.
DutchGhost
commented
Jun 4, 2018
•
|
Its not only with unimplemented!(): using #![feature(nll)]
fn main() {
let mut v = Vec::new();
loop { v.push(break) }
}
Backtrace:
|
This comment has been minimized.
This comment has been minimized.
|
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 |
dylanede commentedJun 4, 2018
Here is a fairly small test case (playground):
The error message is