]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_mir/src/interpret/intrinsics.rs
abort() now takes a msg parameter
[rust.git] / compiler / rustc_mir / src / interpret / intrinsics.rs
index 90018673e1a8a9b3c180871e6f396c519937e128..18abf4291b1e2c5231bd226de089d63fd1ab8ce3 100644 (file)
@@ -126,7 +126,7 @@ pub fn emulate_intrinsic(
             None => match intrinsic_name {
                 sym::transmute => throw_ub_format!("transmuting to uninhabited type"),
                 sym::unreachable => throw_ub!(Unreachable),
-                sym::abort => M::abort(self)?,
+                sym::abort => M::abort(self, "aborted execution".to_owned())?,
                 // Unsupported diverging intrinsic.
                 _ => return Ok(false),
             },
@@ -412,7 +412,7 @@ pub fn emulate_intrinsic(
                 let layout = self.layout_of(ty)?;
 
                 if layout.abi.is_uninhabited() {
-                    throw_ub_format!("attempted to instantiate uninhabited type `{}`", ty);
+                    M::abort(self, format!("attempted to instantiate uninhabited type `{}`", ty))?;
                 }
             }
             sym::simd_insert => {