Skip to content

Commit bdda98a

Browse files
usbalbinRalfJung
andauthored
Add comment for assert_inhabited in compiler/rustc_mir/src/interpret/intrinsics.rs
Co-authored-by: Ralf Jung <[email protected]>
1 parent d0a1e40 commit bdda98a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

compiler/rustc_mir/src/interpret/intrinsics.rs

+2
Original file line numberDiff line numberDiff line change
@@ -412,6 +412,8 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
412412
let layout = self.layout_of(ty)?;
413413

414414
if layout.abi.is_uninhabited() {
415+
// The run-time intrinsic panics just to get a good backtrace; here we abort
416+
// since there is no problem showing a backtrace even for aborts.
415417
M::abort(self, format!("attempted to instantiate uninhabited type `{}`", ty))?;
416418
}
417419
}

0 commit comments

Comments
 (0)