Skip to content

Commit 9fc8de0

Browse files
authored
Rollup merge of rust-lang#109058 - tmiasko:is-checkable, r=jackh726
Document BinOp::is_checkable
2 parents f33292f + b16d6cc commit 9fc8de0

File tree

1 file changed

+3
-0
lines changed
  • compiler/rustc_middle/src/mir

1 file changed

+3
-0
lines changed

compiler/rustc_middle/src/mir/mod.rs

+3
Original file line numberDiff line numberDiff line change
@@ -1999,6 +1999,9 @@ impl BorrowKind {
19991999
}
20002000

20012001
impl BinOp {
2002+
/// The checkable operators are those whose overflow checking behavior is controlled by
2003+
/// -Coverflow-checks option. The remaining operators have either no overflow conditions (e.g.,
2004+
/// BitAnd, BitOr, BitXor) or are always checked for overflow (e.g., Div, Rem).
20022005
pub fn is_checkable(self) -> bool {
20032006
use self::BinOp::*;
20042007
matches!(self, Add | Sub | Mul | Shl | Shr)

0 commit comments

Comments
 (0)