File tree 2 files changed +10
-5
lines changed
2 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -46,6 +46,13 @@ macro_rules! err_exhaust {
46
46
} ;
47
47
}
48
48
49
+ #[ macro_export]
50
+ macro_rules! err_machine_stop {
51
+ ( $( $tt: tt) * ) => {
52
+ $crate:: mir:: interpret:: InterpError :: MachineStop ( Box :: new( $( $tt) * ) )
53
+ } ;
54
+ }
55
+
49
56
// In the `throw_*` macros, avoid `return` to make them work with `try {}`.
50
57
#[ macro_export]
51
58
macro_rules! throw_unsup {
@@ -79,9 +86,7 @@ macro_rules! throw_exhaust {
79
86
80
87
#[ macro_export]
81
88
macro_rules! throw_machine_stop {
82
- ( $( $tt: tt) * ) => {
83
- Err :: <!, _>( $crate:: mir:: interpret:: InterpError :: MachineStop ( Box :: new( $( $tt) * ) ) ) ?
84
- } ;
89
+ ( $( $tt: tt) * ) => { Err :: <!, _>( err_machine_stop!( $( $tt) * ) ) ? } ;
85
90
}
86
91
87
92
mod allocation;
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ use rustc::mir::AssertKind;
5
5
use rustc_span:: Symbol ;
6
6
7
7
use super :: InterpCx ;
8
- use crate :: interpret:: { ConstEvalErr , InterpError , InterpErrorInfo , Machine } ;
8
+ use crate :: interpret:: { ConstEvalErr , InterpErrorInfo , Machine } ;
9
9
10
10
/// The CTFE machine has some custom error kinds.
11
11
#[ derive( Clone , Debug ) ]
@@ -21,7 +21,7 @@ pub enum ConstEvalErrKind {
21
21
// handle these.
22
22
impl < ' tcx > Into < InterpErrorInfo < ' tcx > > for ConstEvalErrKind {
23
23
fn into ( self ) -> InterpErrorInfo < ' tcx > {
24
- InterpError :: MachineStop ( Box :: new ( self . to_string ( ) ) ) . into ( )
24
+ err_machine_stop ! ( self . to_string( ) ) . into ( )
25
25
}
26
26
}
27
27
You can’t perform that action at this time.
0 commit comments