Skip to content

Commit 727e778

Browse files
committed
Auto merge of #1029 - RalfJung:panic-if-uninhabited, r=RalfJung
calling panic_if_uninhabited is not actually UB
2 parents 4f71715 + 955a26f commit 727e778

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/shims/intrinsics.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,8 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
381381
let ty = substs.type_at(0);
382382
let layout = this.layout_of(ty)?;
383383
if layout.abi.is_uninhabited() {
384-
throw_ub_format!("Trying to instantiate uninhabited type {}", ty)
384+
// FIXME: This should throw a panic in the interpreted program instead.
385+
throw_unsup_format!("Trying to instantiate uninhabited type {}", ty)
385386
}
386387
}
387388

0 commit comments

Comments
 (0)