1
Fork 0

Add default implementation for enforce_abi()

This commit is contained in:
hyd-dev 2021-05-22 19:04:28 +08:00
parent c69fba929b
commit 7e42c975b9
No known key found for this signature in database
GPG key ID: 74FA7FD5B8DA14B8

View file

@ -133,7 +133,9 @@ pub trait Machine<'mir, 'tcx>: Sized {
fn enforce_validity(ecx: &InterpCx<'mir, 'tcx, Self>) -> bool;
/// Whether function calls should be [ABI](Abi)-checked.
fn enforce_abi(ecx: &InterpCx<'mir, 'tcx, Self>) -> bool;
fn enforce_abi(_ecx: &InterpCx<'mir, 'tcx, Self>) -> bool {
true
}
/// Entry point for obtaining the MIR of anything that should get evaluated.
/// 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>) {
false // for now, we don't enforce validity
}
#[inline(always)]
fn enforce_abi(_ecx: &InterpCx<$mir, $tcx, Self>) -> bool {
true
}
#[inline(always)]
fn call_extra_fn(
_ecx: &mut InterpCx<$mir, $tcx, Self>,