Skip to content

Commit 7ec919d

Browse files
author
hyd-dev
committed
Remove the macro and expand it manually
1 parent 633ac2a commit 7ec919d

File tree

5 files changed

+148
-43
lines changed

5 files changed

+148
-43
lines changed

src/shims/foreign_items.rs

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -13,36 +13,6 @@ use crate::*;
1313
use super::backtrace::EvalContextExt as _;
1414
use 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-
4616
impl<'mir, 'tcx: 'mir> EvalContextExt<'mir, 'tcx> for crate::MiriEvalContext<'mir, 'tcx> {}
4717
pub 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

Comments
 (0)