Rollup merge of #94017 - fee1-dead:unub, r=bjorn3

Clarify confusing UB statement in MIR
This commit is contained in:
Matthias Krüger 2022-02-16 18:59:31 +01:00 committed by GitHub
commit a5a1ffb178
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2270,11 +2270,13 @@ pub enum BinOp {
Mul, Mul,
/// The `/` operator (division) /// The `/` operator (division)
/// ///
/// Division by zero is UB. /// Division by zero is UB, because the compiler should have inserted checks
/// prior to this.
Div, Div,
/// The `%` operator (modulus) /// 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, Rem,
/// The `^` operator (bitwise xor) /// The `^` operator (bitwise xor)
BitXor, BitXor,