Closed
Description
struct CompileError;
impl Drop for CompileError {
fn drop(&mut self) {}
}
impl CompileError {
fn throw(&self) {}
}
fn main() {
'code: {
break 'code;
CompileError.throw()
};
}
Build with
-Zvalidate-mir
error: internal compiler error: broken MIR in Item(DefId(0:9 ~ ice[5cf9]::main)) (before pass CheckPackedRef) at bb4[0]:
use of local _3, which has no storage here
--> src/main.rs:15:6
|
15 | };
| ^
// MIR for `main` after built
fn main() -> () {
let mut _0: ();
let _1: ();
let mut _2: &CompileError;
let _3: CompileError;
bb0: {
StorageLive(_1);
_1 = const ();
goto -> bb3;
}
bb1: {
StorageLive(_2);
StorageLive(_3);
_3 = CompileError;
_2 = &_3;
_1 = CompileError::throw(move _2) -> [return: bb2, unwind: bb6];
}
bb2: {
StorageDead(_2);
goto -> bb4;
}
bb3: {
goto -> bb4;
}
bb4: {
drop(_3) -> [return: bb5, unwind: bb7];
}
bb5: {
StorageDead(_3);
StorageDead(_1);
_0 = const ();
return;
}
bb6 (cleanup): {
drop(_3) -> [return: bb7, unwind terminate(cleanup)];
}
bb7 (cleanup): {
resume;
}
}