11//! An interpreter for MIR used in CTFE and by miri
22
33#[ macro_export]
4- macro_rules! throw_unsup {
5- ( $( $tt: tt) * ) => { return Err ( err_unsup!( $( $tt) * ) . into( ) ) } ;
6- }
7-
8- #[ macro_export]
9- macro_rules! throw_inval {
10- ( $( $tt: tt) * ) => { return Err ( err_inval!( $( $tt) * ) . into( ) ) } ;
11- }
12-
13- #[ macro_export]
14- macro_rules! throw_ub {
4+ macro_rules! err_unsup {
155 ( $( $tt: tt) * ) => {
16- return Err ( $crate:: mir:: interpret:: InterpError :: UndefinedBehaviour (
17- $crate:: mir:: interpret:: UndefinedBehaviourInfo :: $( $tt) *
18- ) . into ( ) )
6+ $crate:: mir:: interpret:: InterpError :: Unsupported (
7+ $crate:: mir:: interpret:: UnsupportedOpInfo :: $( $tt) *
8+ )
199 } ;
2010}
2111
22- #[ macro_export]
23- macro_rules! throw_panic {
24- ( $( $tt: tt) * ) => { return Err ( err_panic!( $( $tt) * ) . into( ) ) } ;
25- }
26-
27- #[ macro_export]
28- macro_rules! throw_exhaust {
29- ( $( $tt: tt) * ) => { return Err ( err_exhaust!( $( $tt) * ) . into( ) ) } ;
30- }
31-
3212#[ macro_export]
3313macro_rules! err_inval {
3414 ( $( $tt: tt) * ) => {
@@ -39,10 +19,19 @@ macro_rules! err_inval {
3919}
4020
4121#[ macro_export]
42- macro_rules! err_unsup {
22+ macro_rules! err_ub {
4323 ( $( $tt: tt) * ) => {
44- $crate:: mir:: interpret:: InterpError :: Unsupported (
45- $crate:: mir:: interpret:: UnsupportedOpInfo :: $( $tt) *
24+ $crate:: mir:: interpret:: InterpError :: UndefinedBehaviour (
25+ $crate:: mir:: interpret:: UndefinedBehaviourInfo :: $( $tt) *
26+ )
27+ } ;
28+ }
29+
30+ #[ macro_export]
31+ macro_rules! err_panic {
32+ ( $( $tt: tt) * ) => {
33+ $crate:: mir:: interpret:: InterpError :: Panic (
34+ $crate:: mir:: interpret:: PanicInfo :: $( $tt) *
4635 )
4736 } ;
4837}
@@ -57,14 +46,34 @@ macro_rules! err_exhaust {
5746}
5847
5948#[ macro_export]
60- macro_rules! err_panic {
49+ macro_rules! throw_unsup {
50+ ( $( $tt: tt) * ) => { return Err ( err_unsup!( $( $tt) * ) . into( ) ) } ;
51+ }
52+
53+ #[ macro_export]
54+ macro_rules! throw_inval {
55+ ( $( $tt: tt) * ) => { return Err ( err_inval!( $( $tt) * ) . into( ) ) } ;
56+ }
57+
58+ #[ macro_export]
59+ macro_rules! throw_ub {
6160 ( $( $tt: tt) * ) => {
62- $crate:: mir:: interpret:: InterpError :: Panic (
63- $crate:: mir:: interpret:: PanicInfo :: $( $tt) *
64- )
61+ return Err ( $crate:: mir:: interpret:: InterpError :: UndefinedBehaviour (
62+ $crate:: mir:: interpret:: UndefinedBehaviourInfo :: $( $tt) *
63+ ) . into ( ) )
6564 } ;
6665}
6766
67+ #[ macro_export]
68+ macro_rules! throw_panic {
69+ ( $( $tt: tt) * ) => { return Err ( err_panic!( $( $tt) * ) . into( ) ) } ;
70+ }
71+
72+ #[ macro_export]
73+ macro_rules! throw_exhaust {
74+ ( $( $tt: tt) * ) => { return Err ( err_exhaust!( $( $tt) * ) . into( ) ) } ;
75+ }
76+
6877mod error;
6978mod value;
7079mod allocation;
0 commit comments