Skip to content

Commit c905497

Browse files
committed
miri: binary_op_val -> binary_op_imm
1 parent 0117b42 commit c905497

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/librustc_mir/interpret/intrinsics.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ impl<'a, 'mir, 'tcx, M: Machine<'a, 'mir, 'tcx>> EvalContext<'a, 'mir, 'tcx, M>
140140
"unchecked_shr" => BinOp::Shr,
141141
_ => bug!("Already checked for int ops")
142142
};
143-
let (val, overflowed) = self.binary_op_val(bin_op, l, r)?;
143+
let (val, overflowed) = self.binary_op_imm(bin_op, l, r)?;
144144
if overflowed {
145145
let layout = self.layout_of(substs.type_at(0))?;
146146
let r_val = r.to_scalar()?.to_bits(layout.size)?;

src/librustc_mir/interpret/operator.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ impl<'a, 'mir, 'tcx, M: Machine<'a, 'mir, 'tcx>> EvalContext<'a, 'mir, 'tcx, M>
2828
right: ImmTy<'tcx, M::PointerTag>,
2929
dest: PlaceTy<'tcx, M::PointerTag>,
3030
) -> EvalResult<'tcx> {
31-
let (val, overflowed) = self.binary_op_val(op, left, right)?;
31+
let (val, overflowed) = self.binary_op_imm(op, left, right)?;
3232
let val = Immediate::ScalarPair(val.into(), Scalar::from_bool(overflowed).into());
3333
self.write_immediate(val, dest)
3434
}
@@ -42,7 +42,7 @@ impl<'a, 'mir, 'tcx, M: Machine<'a, 'mir, 'tcx>> EvalContext<'a, 'mir, 'tcx, M>
4242
right: ImmTy<'tcx, M::PointerTag>,
4343
dest: PlaceTy<'tcx, M::PointerTag>,
4444
) -> EvalResult<'tcx> {
45-
let (val, _overflowed) = self.binary_op_val(op, left, right)?;
45+
let (val, _overflowed) = self.binary_op_imm(op, left, right)?;
4646
self.write_scalar(val, dest)
4747
}
4848
}
@@ -283,9 +283,9 @@ impl<'a, 'mir, 'tcx, M: Machine<'a, 'mir, 'tcx>> EvalContext<'a, 'mir, 'tcx, M>
283283
}
284284

285285
/// Convenience wrapper that's useful when keeping the layout together with the
286-
/// value.
286+
/// immediate value.
287287
#[inline]
288-
pub fn binary_op_val(
288+
pub fn binary_op_imm(
289289
&self,
290290
bin_op: mir::BinOp,
291291
left: ImmTy<'tcx, M::PointerTag>,

src/librustc_mir/transform/const_prop.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ impl<'a, 'mir, 'tcx> ConstPropagator<'a, 'mir, 'tcx> {
455455
})?;
456456
trace!("const evaluating {:?} for {:?} and {:?}", op, left, right);
457457
let (val, overflow) = self.use_ecx(source_info, |this| {
458-
this.ecx.binary_op_val(op, l, r)
458+
this.ecx.binary_op_imm(op, l, r)
459459
})?;
460460
let val = if let Rvalue::CheckedBinaryOp(..) = *rvalue {
461461
Immediate::ScalarPair(

0 commit comments

Comments
 (0)