about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2019-12-03 19:41:52 +0100
committerGitHub <noreply@github.com>2019-12-03 19:41:52 +0100
commit71d1286bdf5cc094532a6263ad4cfaad5c54d097 (patch)
tree6c79576fa5ef16a90f692c19465b1506515bcdf8
parentd4b623547fc2a7ee774ec3db89c89858c68cd10c (diff)
parentff5fcac6c240fd40e24356dd4fab07bbb2b41f5e (diff)
Rollup merge of #66951 - RalfJung:miri-machine-stop, r=oli-obk
miri: add throw_machine_stop macro

r? @oli-obk
This helps Miri: https://github.com/rust-lang/miri/pull/1093
-rw-r--r--src/librustc/mir/interpret/mod.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/librustc/mir/interpret/mod.rs b/src/librustc/mir/interpret/mod.rs
index 65f4ee88a9c..fff876752db 100644
--- a/src/librustc/mir/interpret/mod.rs
+++ b/src/librustc/mir/interpret/mod.rs
@@ -90,6 +90,13 @@ macro_rules! throw_exhaust {
     ($($tt:tt)*) => { return Err(err_exhaust!($($tt)*).into()) };
 }
 
+#[macro_export]
+macro_rules! throw_machine_stop {
+    ($($tt:tt)*) => {
+        return Err($crate::mir::interpret::InterpError::MachineStop(Box::new($($tt)*)).into())
+    };
+}
+
 mod error;
 mod value;
 mod allocation;