Skip to content

Commit a5a1ffb

Browse files
authored
Rollup merge of #94017 - fee1-dead:unub, r=bjorn3
Clarify confusing UB statement in MIR
2 parents 75a631d + 7fa87f2 commit a5a1ffb

File tree

1 file changed

+4
-2
lines changed
  • compiler/rustc_middle/src/mir

1 file changed

+4
-2
lines changed

compiler/rustc_middle/src/mir/mod.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -2270,11 +2270,13 @@ pub enum BinOp {
22702270
Mul,
22712271
/// The `/` operator (division)
22722272
///
2273-
/// Division by zero is UB.
2273+
/// Division by zero is UB, because the compiler should have inserted checks
2274+
/// prior to this.
22742275
Div,
22752276
/// The `%` operator (modulus)
22762277
///
2277-
/// Using zero as the modulus (second operand) is UB.
2278+
/// Using zero as the modulus (second operand) is UB, because the compiler
2279+
/// should have inserted checks prior to this.
22782280
Rem,
22792281
/// The `^` operator (bitwise xor)
22802282
BitXor,

0 commit comments

Comments
 (0)