Skip to content

Commit 9cbbd4a

Browse files
committed
Generalize the Assume intrinsic statement to a general Intrinsic statement
1 parent e1b3483 commit 9cbbd4a

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

clippy_utils/src/qualify_min_const_fn.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use rustc_hir as hir;
77
use rustc_hir::def_id::DefId;
88
use rustc_middle::mir::{
99
Body, CastKind, NullOp, Operand, Place, ProjectionElem, Rvalue, Statement, StatementKind, Terminator,
10-
TerminatorKind,
10+
TerminatorKind, NonDivergingIntrinsic
1111
};
1212
use rustc_middle::ty::subst::GenericArgKind;
1313
use rustc_middle::ty::{self, adjustment::PointerCast, Ty, TyCtxt};
@@ -211,15 +211,19 @@ fn check_statement<'tcx>(
211211
StatementKind::SetDiscriminant { place, .. } | StatementKind::Deinit(place) => {
212212
check_place(tcx, **place, span, body)
213213
},
214-
StatementKind::Assume(box op) => {
214+
215+
StatementKind::Intrinsic(box NonDivergingIntrinsic::Assume(op)) => {
215216
check_operand(tcx, op, span, body)
216217
},
217218

218-
StatementKind::CopyNonOverlapping(box rustc_middle::mir::CopyNonOverlapping { dst, src, count }) => {
219+
StatementKind::Intrinsic(box NonDivergingIntrinsic::CopyNonOverlapping(
220+
rustc_middle::mir::CopyNonOverlapping { dst, src, count },
221+
)) => {
219222
check_operand(tcx, dst, span, body)?;
220223
check_operand(tcx, src, span, body)?;
221224
check_operand(tcx, count, span, body)
222225
},
226+
223227
// These are all NOPs
224228
StatementKind::StorageLive(_)
225229
| StatementKind::StorageDead(_)

0 commit comments

Comments
 (0)