File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
compiler/rustc_middle/src/mir Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -2246,8 +2246,12 @@ pub enum BinOp {
22462246 /// The `*` operator (multiplication)
22472247 Mul ,
22482248 /// The `/` operator (division)
2249+ ///
2250+ /// Division by zero is UB.
22492251 Div ,
22502252 /// The `%` operator (modulus)
2253+ ///
2254+ /// Using zero as the modulus (second operand) is UB.
22512255 Rem ,
22522256 /// The `^` operator (bitwise xor)
22532257 BitXor ,
@@ -2256,8 +2260,12 @@ pub enum BinOp {
22562260 /// The `|` operator (bitwise or)
22572261 BitOr ,
22582262 /// The `<<` operator (shift left)
2263+ ///
2264+ /// The offset is truncated to the size of the first operand before shifting.
22592265 Shl ,
22602266 /// The `>>` operator (shift right)
2267+ ///
2268+ /// The offset is truncated to the size of the first operand before shifting.
22612269 Shr ,
22622270 /// The `==` operator (equality)
22632271 Eq ,
You can’t perform that action at this time.
0 commit comments