Skip to content

Commit 519582a

Browse files
committed
Use place_to_op+ass_mplace_or_imm instead of as_place_or_local for args
This fixes the CI failure
1 parent 57a7a0e commit 519582a

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

compiler/rustc_const_eval/src/interpret/terminator.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -251,15 +251,16 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
251251
}
252252
mir::Operand::Move(place) => {
253253
let place = self.eval_place(*place)?;
254+
let op = self.place_to_op(&place)?;
254255

255-
match place.as_mplace_or_local() {
256+
match op.as_mplace_or_imm() {
256257
Either::Left(mplace) => FnArg::InPlace(mplace),
257-
Either::Right(_local) => {
258+
Either::Right(_imm) => {
258259
// This argument doesn't live in memory, so there's no place
259260
// to make inaccessible during the call.
260261
// This is also crucial for tail calls, where we want the `FnArg` to
261262
// stay valid when the old stack frame gets popped.
262-
FnArg::Copy(self.place_to_op(&place)?)
263+
FnArg::Copy(op)
263264
}
264265
}
265266
}
@@ -742,7 +743,9 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
742743
});
743744
}
744745

745-
if let Either::Left(destination) = destination.as_mplace_or_local() {
746+
if let Either::Left(destination) =
747+
self.place_to_op(&destination)?.as_mplace_or_imm()
748+
{
746749
// Protect return place for in-place return value passing.
747750
M::protect_in_place_function_argument(self, &destination)?;
748751
}

0 commit comments

Comments
 (0)