1
Fork 0

Auto merge of #79910 - RalfJung:abort-msg, r=oli-obk

CTFE: tweak abort-on-uninhabited message

Having an "aborted execution:" makes it more consistent with the `Abort` terminator saying "the program aborted execution". Right now, at least one of the two errors will look weird in Miri.

r? `@oli-obk`
This commit is contained in:
bors 2020-12-11 12:30:05 +00:00
commit a9f7d19a91
3 changed files with 8 additions and 2 deletions

View file

@ -414,7 +414,13 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
if layout.abi.is_uninhabited() {
// The run-time intrinsic panics just to get a good backtrace; here we abort
// since there is no problem showing a backtrace even for aborts.
M::abort(self, format!("attempted to instantiate uninhabited type `{}`", ty))?;
M::abort(
self,
format!(
"aborted execution: attempted to instantiate uninhabited type `{}`",
ty
),
)?;
}
}
sym::simd_insert => {