File tree Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Expand file tree Collapse file tree 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 {
4646 } ;
4747}
4848
49+ #[ macro_export]
50+ macro_rules! err_machine_stop {
51+ ( $( $tt: tt) * ) => {
52+ $crate:: mir:: interpret:: InterpError :: MachineStop ( Box :: new( $( $tt) * ) )
53+ } ;
54+ }
55+
4956// In the `throw_*` macros, avoid `return` to make them work with `try {}`.
5057#[ macro_export]
5158macro_rules! throw_unsup {
@@ -79,9 +86,7 @@ macro_rules! throw_exhaust {
7986
8087#[ macro_export]
8188macro_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) * ) ) ? } ;
8590}
8691
8792mod allocation;
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ use rustc::mir::AssertKind;
55use rustc_span:: Symbol ;
66
77use super :: InterpCx ;
8- use crate :: interpret:: { ConstEvalErr , InterpError , InterpErrorInfo , Machine } ;
8+ use crate :: interpret:: { ConstEvalErr , InterpErrorInfo , Machine } ;
99
1010/// The CTFE machine has some custom error kinds.
1111#[ derive( Clone , Debug ) ]
@@ -21,7 +21,7 @@ pub enum ConstEvalErrKind {
2121// handle these.
2222impl < ' tcx > Into < InterpErrorInfo < ' tcx > > for ConstEvalErrKind {
2323 fn into ( self ) -> InterpErrorInfo < ' tcx > {
24- InterpError :: MachineStop ( Box :: new ( self . to_string ( ) ) ) . into ( )
24+ err_machine_stop ! ( self . to_string( ) ) . into ( )
2525 }
2626}
2727
You can’t perform that action at this time.
0 commit comments