diff options
| author | Scott McMurray <scottmcm@users.noreply.github.com> | 2024-05-16 02:07:31 -0700 |
|---|---|---|
| committer | Scott McMurray <scottmcm@users.noreply.github.com> | 2024-05-17 20:33:02 -0700 |
| commit | 95c0e5c6a86ca467b0fb7043bd56dee82418ac5f (patch) | |
| tree | 961ac9359e2a2d7edcf81a1f97a7ef0a5514e096 /compiler/rustc_const_eval/src/util/mod.rs | |
| parent | 8e78d168040b2d7106a28712c39106602c7a1d61 (diff) | |
| download | rust-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.rs | 9 |
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, } } |
