about summary refs log tree commit diff
path: root/compiler/rustc_const_eval/src/util/mod.rs
diff options
context:
space:
mode:
authorScott McMurray <scottmcm@users.noreply.github.com>2024-05-16 02:07:31 -0700
committerScott McMurray <scottmcm@users.noreply.github.com>2024-05-17 20:33:02 -0700
commit95c0e5c6a86ca467b0fb7043bd56dee82418ac5f (patch)
tree961ac9359e2a2d7edcf81a1f97a7ef0a5514e096 /compiler/rustc_const_eval/src/util/mod.rs
parent8e78d168040b2d7106a28712c39106602c7a1d61 (diff)
downloadrust-95c0e5c6a86ca467b0fb7043bd56dee82418ac5f.tar.gz
rust-95c0e5c6a86ca467b0fb7043bd56dee82418ac5f.zip
Remove `Rvalue::CheckedBinaryOp`
Diffstat (limited to 'compiler/rustc_const_eval/src/util/mod.rs')
-rw-r--r--compiler/rustc_const_eval/src/util/mod.rs9
1 files changed, 6 insertions, 3 deletions
diff --git a/compiler/rustc_const_eval/src/util/mod.rs b/compiler/rustc_const_eval/src/util/mod.rs
index 0c3b59a0e78..66a1addfb52 100644
--- a/compiler/rustc_const_eval/src/util/mod.rs
+++ b/compiler/rustc_const_eval/src/util/mod.rs
@@ -19,7 +19,9 @@ pub fn binop_left_homogeneous(op: mir::BinOp) -> bool {
     match op {
         Add | AddUnchecked | Sub | SubUnchecked | Mul | MulUnchecked | Div | Rem | BitXor
         | BitAnd | BitOr | Offset | Shl | ShlUnchecked | Shr | ShrUnchecked => true,
-        Eq | Ne | Lt | Le | Gt | Ge | Cmp => false,
+        AddWithOverflow | SubWithOverflow | MulWithOverflow | Eq | Ne | Lt | Le | Gt | Ge | Cmp => {
+            false
+        }
     }
 }
 
@@ -29,8 +31,9 @@ pub fn binop_left_homogeneous(op: mir::BinOp) -> bool {
 pub fn binop_right_homogeneous(op: mir::BinOp) -> bool {
     use rustc_middle::mir::BinOp::*;
     match op {
-        Add | AddUnchecked | Sub | SubUnchecked | Mul | MulUnchecked | Div | Rem | BitXor
-        | BitAnd | BitOr | Eq | Ne | Lt | Le | Gt | Ge | Cmp => true,
+        Add | AddUnchecked | AddWithOverflow | Sub | SubUnchecked | SubWithOverflow | Mul
+        | MulUnchecked | MulWithOverflow | Div | Rem | BitXor | BitAnd | BitOr | Eq | Ne | Lt
+        | Le | Gt | Ge | Cmp => true,
         Offset | Shl | ShlUnchecked | Shr | ShrUnchecked => false,
     }
 }