mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 23:04:33 +00:00
document BinOp behavior quirks in the corresponding enum
This commit is contained in:
parent
94c9c22b39
commit
5f6ccf6121
@ -2246,8 +2246,12 @@ pub enum BinOp {
|
||||
/// The `*` operator (multiplication)
|
||||
Mul,
|
||||
/// The `/` operator (division)
|
||||
///
|
||||
/// Division by zero is UB.
|
||||
Div,
|
||||
/// The `%` operator (modulus)
|
||||
///
|
||||
/// Using zero as the modulus (second operand) is UB.
|
||||
Rem,
|
||||
/// The `^` operator (bitwise xor)
|
||||
BitXor,
|
||||
@ -2256,8 +2260,12 @@ pub enum BinOp {
|
||||
/// The `|` operator (bitwise or)
|
||||
BitOr,
|
||||
/// The `<<` operator (shift left)
|
||||
///
|
||||
/// The offset is truncated to the size of the first operand before shifting.
|
||||
Shl,
|
||||
/// The `>>` operator (shift right)
|
||||
///
|
||||
/// The offset is truncated to the size of the first operand before shifting.
|
||||
Shr,
|
||||
/// The `==` operator (equality)
|
||||
Eq,
|
||||
|
Loading…
Reference in New Issue
Block a user