Skip to content

Commit 72c0c08

Browse files
authoredMar 4, 2022
Rollup merge of #94575 - RalfJung:switchint-comment, r=oli-obk
CTFE SwitchInt: update comment I just wondered why this doesn't use `binary_op`. r? ```@oli-obk```
2 parents 308efaf + 0854781 commit 72c0c08

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed
 

‎compiler/rustc_const_eval/src/interpret/terminator.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
3939
let mut target_block = targets.otherwise();
4040

4141
for (const_int, target) in targets.iter() {
42-
// Compare using binary_op, to also support pointer values
42+
// Compare using MIR BinOp::Eq, to also support pointer values.
43+
// (Avoiding `self.binary_op` as that does some redundant layout computation.)
4344
let res = self
4445
.overflowing_binary_op(
4546
mir::BinOp::Eq,

0 commit comments

Comments
 (0)
Please sign in to comment.