Skip to content

Commit acf38f8

Browse files
authored
Rollup merge of rust-lang#125173 - scottmcm:never-checked, r=davidtwco
Remove `Rvalue::CheckedBinaryOp` Zulip conversation: <https://rust-lang.zulipchat.com/#narrow/stream/189540-t-compiler.2Fwg-mir-opt/topic/intrinsics.20vs.20binop.2Funop/near/438729996> cc `@RalfJung` While it's a draft, r? ghost
2 parents 298f38c + 0cd64b5 commit acf38f8

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

clippy_utils/src/mir/possible_borrower.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ impl TypeVisitor<TyCtxt<'_>> for ContainsRegion {
149149
}
150150

151151
fn rvalue_locals(rvalue: &mir::Rvalue<'_>, mut visit: impl FnMut(mir::Local)) {
152-
use rustc_middle::mir::Rvalue::{Aggregate, BinaryOp, Cast, CheckedBinaryOp, Repeat, UnaryOp, Use};
152+
use rustc_middle::mir::Rvalue::{Aggregate, BinaryOp, Cast, Repeat, UnaryOp, Use};
153153

154154
let mut visit_op = |op: &mir::Operand<'_>| match op {
155155
mir::Operand::Copy(p) | mir::Operand::Move(p) => visit(p.local),
@@ -159,7 +159,7 @@ fn rvalue_locals(rvalue: &mir::Rvalue<'_>, mut visit: impl FnMut(mir::Local)) {
159159
match rvalue {
160160
Use(op) | Repeat(op, _) | Cast(_, op, _) | UnaryOp(_, op) => visit_op(op),
161161
Aggregate(_, ops) => ops.iter().for_each(visit_op),
162-
BinaryOp(_, box (lhs, rhs)) | CheckedBinaryOp(_, box (lhs, rhs)) => {
162+
BinaryOp(_, box (lhs, rhs)) => {
163163
visit_op(lhs);
164164
visit_op(rhs);
165165
},

clippy_utils/src/qualify_min_const_fn.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ fn check_rvalue<'tcx>(
161161
"transmute can attempt to turn pointers into integers, so is unstable in const fn".into(),
162162
)),
163163
// binops are fine on integers
164-
Rvalue::BinaryOp(_, box (lhs, rhs)) | Rvalue::CheckedBinaryOp(_, box (lhs, rhs)) => {
164+
Rvalue::BinaryOp(_, box (lhs, rhs)) => {
165165
check_operand(tcx, lhs, span, body)?;
166166
check_operand(tcx, rhs, span, body)?;
167167
let ty = lhs.ty(body, tcx);

0 commit comments

Comments
 (0)