1
1
//! An interpreter for MIR used in CTFE and by miri
2
2
3
3
#[ 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 {
15
5
( $( $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
+ )
19
9
} ;
20
10
}
21
11
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
-
32
12
#[ macro_export]
33
13
macro_rules! err_inval {
34
14
( $( $tt: tt) * ) => {
@@ -39,10 +19,19 @@ macro_rules! err_inval {
39
19
}
40
20
41
21
#[ macro_export]
42
- macro_rules! err_unsup {
22
+ macro_rules! err_ub {
43
23
( $( $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) *
46
35
)
47
36
} ;
48
37
}
@@ -57,14 +46,34 @@ macro_rules! err_exhaust {
57
46
}
58
47
59
48
#[ 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 {
61
60
( $( $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 ( ) )
65
64
} ;
66
65
}
67
66
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
+
68
77
mod error;
69
78
mod value;
70
79
mod allocation;
0 commit comments