1
Fork 0

Clarify confusing UB statement in MIR

This commit is contained in:
Deadbeef 2022-02-15 22:22:37 +11:00
parent 6655109f58
commit 7fa87f2535
No known key found for this signature in database
GPG key ID: 6D017A96D8E6C2F9

View file

@ -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,