Skip to content

Commit

Permalink
Rollup merge of #94575 - RalfJung:switchint-comment, r=oli-obk
Browse files Browse the repository at this point in the history
CTFE SwitchInt: update comment

I just wondered why this doesn't use `binary_op`.

r? ```@oli-obk```
  • Loading branch information
Dylan-DPC authored Mar 4, 2022
2 parents 308efaf + 0854781 commit 72c0c08
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion compiler/rustc_const_eval/src/interpret/terminator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
let mut target_block = targets.otherwise();

for (const_int, target) in targets.iter() {
// Compare using binary_op, to also support pointer values
// Compare using MIR BinOp::Eq, to also support pointer values.
// (Avoiding `self.binary_op` as that does some redundant layout computation.)
let res = self
.overflowing_binary_op(
mir::BinOp::Eq,
Expand Down

0 comments on commit 72c0c08

Please sign in to comment.