@@ -13,36 +13,6 @@ use crate::*;
1313use super :: backtrace:: EvalContextExt as _;
1414use helpers:: { check_abi, check_arg_count} ;
1515
16- /// This macro behaves just like `match $link_name { ... }`, but inserts a
17- /// `$crate::helpers::check_abi($abi, $exp_abi)?` call at each match arm
18- /// except the wildcard one.
19- #[ macro_export]
20- macro_rules! match_with_abi_check {
21- ( $link_name: expr, $abi: expr, $exp_abi: expr, {
22- $( |) ? $( $pattern: pat) |+ $( if $guard: expr) ? => $shim_impl: block
23- $( $remaining: tt) +
24- } ) => {
25- match ( $link_name, $abi, $exp_abi) {
26- ( $( $pattern) |+, abi, exp_abi) $( if $guard) ? => {
27- $crate:: helpers:: check_abi( abi, exp_abi) ?;
28- $shim_impl
29- }
30- ( link_name, abi, exp_abi) => match_with_abi_check!(
31- link_name,
32- abi,
33- exp_abi,
34- { $( $remaining) * }
35- ) ,
36- }
37- } ;
38- ( $link_name: ident, $abi: ident, $exp_abi: ident, {
39- _ => $fallback: expr $( , ) ?
40- } ) => ( {
41- let _ = ( $link_name, $abi, $exp_abi) ;
42- $fallback
43- } ) ;
44- }
45-
4616impl < ' mir , ' tcx : ' mir > EvalContextExt < ' mir , ' tcx > for crate :: MiriEvalContext < ' mir , ' tcx > { }
4717pub trait EvalContextExt < ' mir , ' tcx : ' mir > : crate :: MiriEvalContextExt < ' mir , ' tcx > {
4818 /// Returns the minimum alignment for the target architecture for allocations of the given size.
0 commit comments