Skip to content

Commit

Permalink
Rollup merge of #94017 - fee1-dead:unub, r=bjorn3
Browse files Browse the repository at this point in the history
Clarify confusing UB statement in MIR
  • Loading branch information
matthiaskrgr committed Feb 16, 2022
2 parents 75a631d + 7fa87f2 commit a5a1ffb
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions compiler/rustc_middle/src/mir/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2270,11 +2270,13 @@ pub enum BinOp {
Mul,
/// The `/` operator (division)
///
/// Division by zero is UB.
/// Division by zero is UB, because the compiler should have inserted checks
/// prior to this.
Div,
/// The `%` operator (modulus)
///
/// Using zero as the modulus (second operand) is UB.
/// Using zero as the modulus (second operand) is UB, because the compiler
/// should have inserted checks prior to this.
Rem,
/// The `^` operator (bitwise xor)
BitXor,
Expand Down

0 comments on commit a5a1ffb

Please sign in to comment.