Skip to content

Commit

Permalink
Use place_to_op+ass_mplace_or_imm instead of as_place_or_local
Browse files Browse the repository at this point in the history
…for args

This fixes the CI failure
  • Loading branch information
WaffleLapkin committed Mar 6, 2024
1 parent 57a7a0e commit 519582a
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions compiler/rustc_const_eval/src/interpret/terminator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -251,15 +251,16 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
}
mir::Operand::Move(place) => {
let place = self.eval_place(*place)?;
let op = self.place_to_op(&place)?;

match place.as_mplace_or_local() {
match op.as_mplace_or_imm() {
Either::Left(mplace) => FnArg::InPlace(mplace),
Either::Right(_local) => {
Either::Right(_imm) => {
// This argument doesn't live in memory, so there's no place
// to make inaccessible during the call.
// This is also crucial for tail calls, where we want the `FnArg` to
// stay valid when the old stack frame gets popped.
FnArg::Copy(self.place_to_op(&place)?)
FnArg::Copy(op)
}
}
}
Expand Down Expand Up @@ -742,7 +743,9 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
});
}

if let Either::Left(destination) = destination.as_mplace_or_local() {
if let Either::Left(destination) =
self.place_to_op(&destination)?.as_mplace_or_imm()
{
// Protect return place for in-place return value passing.
M::protect_in_place_function_argument(self, &destination)?;
}
Expand Down

0 comments on commit 519582a

Please sign in to comment.