Skip to content

Commit 3f7de70

Browse files
committed
Pass FnAbi to find_mir_or_eval_fn
1 parent 76fd471 commit 3f7de70

File tree

5 files changed

+10
-0
lines changed

5 files changed

+10
-0
lines changed

compiler/rustc_const_eval/src/const_eval/dummy_machine.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
use rustc_middle::mir::interpret::{AllocId, ConstAllocation, InterpResult};
22
use rustc_middle::mir::*;
33
use rustc_middle::query::TyCtxtAt;
4+
use rustc_middle::ty::Ty;
45
use rustc_middle::ty::layout::TyAndLayout;
56
use rustc_middle::{bug, span_bug, ty};
67
use rustc_span::def_id::DefId;
8+
use rustc_target::callconv::FnAbi;
79

810
use crate::interpret::{
911
self, HasStaticRootDefId, ImmTy, Immediate, InterpCx, PointerArithmetic, interp_ok,
@@ -87,6 +89,7 @@ impl<'tcx> interpret::Machine<'tcx> for DummyMachine {
8789
_ecx: &mut InterpCx<'tcx, Self>,
8890
_instance: ty::Instance<'tcx>,
8991
_abi: rustc_abi::ExternAbi,
92+
_fnabi: &FnAbi<'tcx, Ty<'tcx>>,
9093
_args: &[interpret::FnArg<'tcx, Self::Provenance>],
9194
_destination: &interpret::MPlaceTy<'tcx, Self::Provenance>,
9295
_target: Option<BasicBlock>,

compiler/rustc_const_eval/src/const_eval/machine.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ use rustc_middle::ty::{self, Ty, TyCtxt};
1414
use rustc_middle::{bug, mir};
1515
use rustc_span::Span;
1616
use rustc_span::symbol::{Symbol, sym};
17+
use rustc_target::callconv::FnAbi;
1718
use tracing::debug;
1819

1920
use super::error::*;
@@ -335,6 +336,7 @@ impl<'tcx> interpret::Machine<'tcx> for CompileTimeMachine<'tcx> {
335336
ecx: &mut InterpCx<'tcx, Self>,
336337
orig_instance: ty::Instance<'tcx>,
337338
_abi: ExternAbi,
339+
_fnabi: &FnAbi<'tcx, Ty<'tcx>>,
338340
args: &[FnArg<'tcx>],
339341
dest: &MPlaceTy<'tcx>,
340342
ret: Option<mir::BasicBlock>,

compiler/rustc_const_eval/src/interpret/call.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -571,6 +571,7 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
571571
self,
572572
instance,
573573
caller_abi,
574+
caller_fn_abi,
574575
args,
575576
destination,
576577
target,

compiler/rustc_const_eval/src/interpret/machine.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ use rustc_middle::ty::layout::TyAndLayout;
1515
use rustc_middle::{mir, ty};
1616
use rustc_span::Span;
1717
use rustc_span::def_id::DefId;
18+
use rustc_target::callconv::FnAbi;
1819

1920
use super::{
2021
AllocBytes, AllocId, AllocKind, AllocRange, Allocation, CTFE_ALLOC_SALT, ConstAllocation,
@@ -202,6 +203,7 @@ pub trait Machine<'tcx>: Sized {
202203
ecx: &mut InterpCx<'tcx, Self>,
203204
instance: ty::Instance<'tcx>,
204205
abi: ExternAbi,
206+
_fnabi: &FnAbi<'tcx, Ty<'tcx>>,
205207
args: &[FnArg<'tcx, Self::Provenance>],
206208
destination: &MPlaceTy<'tcx, Self::Provenance>,
207209
target: Option<mir::BasicBlock>,

src/tools/miri/src/machine.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ use std::{fmt, process};
1111
use rand::rngs::StdRng;
1212
use rand::{Rng, SeedableRng};
1313
use rustc_abi::{Align, ExternAbi, Size};
14+
use rustc_target::callconv::FnAbi;
1415
use rustc_attr::InlineAttr;
1516
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
1617
#[allow(unused)]
@@ -1006,6 +1007,7 @@ impl<'tcx> Machine<'tcx> for MiriMachine<'tcx> {
10061007
ecx: &mut MiriInterpCx<'tcx>,
10071008
instance: ty::Instance<'tcx>,
10081009
abi: ExternAbi,
1010+
_fnabi: &FnAbi<'tcx, Ty<'tcx>>,
10091011
args: &[FnArg<'tcx, Provenance>],
10101012
dest: &MPlaceTy<'tcx>,
10111013
ret: Option<mir::BasicBlock>,

0 commit comments

Comments
 (0)