Skip to content

Commit ee5585e

Browse files
committed
interpret: project_downcast: do not ICE for uninhabited variants
1 parent 48d3fb7 commit ee5585e

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// Validation stops the test before the ICE we used to hit
2+
//@compile-flags: -Zmiri-disable-validation
3+
4+
#![feature(never_type)]
5+
#[derive(Copy, Clone)]
6+
pub enum E {
7+
A(!),
8+
}
9+
pub union U {
10+
u: (),
11+
e: E,
12+
}
13+
14+
fn main() {
15+
let E::A(ref _a) = unsafe { &(&U { u: () }).e };
16+
}

0 commit comments

Comments
 (0)