about summary refs log tree commit diff
path: root/compiler
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2023-03-13 21:55:37 +0100
committerGitHub <noreply@github.com>2023-03-13 21:55:37 +0100
commit9fc8de0caa14534579c1ac97a98dbb70d91d02a5 (patch)
tree73e6698807ac55737d8fd451a040097dc2a0116d /compiler
parentf33292fa5d85165fea55682c367827cf37f21216 (diff)
parentb16d6ccdcd4653f2b1e347901c4fab6c8927e645 (diff)
downloadrust-9fc8de0caa14534579c1ac97a98dbb70d91d02a5.tar.gz
rust-9fc8de0caa14534579c1ac97a98dbb70d91d02a5.zip
Rollup merge of #109058 - tmiasko:is-checkable, r=jackh726
Document BinOp::is_checkable
Diffstat (limited to 'compiler')
-rw-r--r--compiler/rustc_middle/src/mir/mod.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/compiler/rustc_middle/src/mir/mod.rs b/compiler/rustc_middle/src/mir/mod.rs
index 5215e3db798..b34651c3ea7 100644
--- a/compiler/rustc_middle/src/mir/mod.rs
+++ b/compiler/rustc_middle/src/mir/mod.rs
@@ -1999,6 +1999,9 @@ impl BorrowKind {
 }
 
 impl BinOp {
+    /// The checkable operators are those whose overflow checking behavior is controlled by
+    /// -Coverflow-checks option. The remaining operators have either no overflow conditions (e.g.,
+    /// BitAnd, BitOr, BitXor) or are always checked for overflow (e.g., Div, Rem).
     pub fn is_checkable(self) -> bool {
         use self::BinOp::*;
         matches!(self, Add | Sub | Mul | Shl | Shr)