Skip to content

Commit 7e42c97

Browse files
author
hyd-dev
committed
Add default implementation for enforce_abi()
1 parent c69fba9 commit 7e42c97

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

compiler/rustc_mir/src/interpret/machine.rs

+3-6
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,9 @@ pub trait Machine<'mir, 'tcx>: Sized {
133133
fn enforce_validity(ecx: &InterpCx<'mir, 'tcx, Self>) -> bool;
134134

135135
/// Whether function calls should be [ABI](Abi)-checked.
136-
fn enforce_abi(ecx: &InterpCx<'mir, 'tcx, Self>) -> bool;
136+
fn enforce_abi(_ecx: &InterpCx<'mir, 'tcx, Self>) -> bool {
137+
true
138+
}
137139

138140
/// Entry point for obtaining the MIR of anything that should get evaluated.
139141
/// So not just functions and shims, but also const/static initializers, anonymous
@@ -447,11 +449,6 @@ pub macro compile_time_machine(<$mir: lifetime, $tcx: lifetime>) {
447449
false // for now, we don't enforce validity
448450
}
449451

450-
#[inline(always)]
451-
fn enforce_abi(_ecx: &InterpCx<$mir, $tcx, Self>) -> bool {
452-
true
453-
}
454-
455452
#[inline(always)]
456453
fn call_extra_fn(
457454
_ecx: &mut InterpCx<$mir, $tcx, Self>,

0 commit comments

Comments
 (0)