diff options
| author | Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de> | 2022-07-12 10:05:00 +0000 |
|---|---|---|
| committer | Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de> | 2022-09-06 14:18:32 +0000 |
| commit | 9cbbd4a80e2bb633c6cfc53a3e9cb08b1910ce5f (patch) | |
| tree | ebdedb0742f63a853aab5dc3796bf8ee0b3c0fbf | |
| parent | e1b3483ee807716e579324f0d107b5365e81d30f (diff) | |
| download | rust-9cbbd4a80e2bb633c6cfc53a3e9cb08b1910ce5f.tar.gz rust-9cbbd4a80e2bb633c6cfc53a3e9cb08b1910ce5f.zip | |
Generalize the Assume intrinsic statement to a general Intrinsic statement
| -rw-r--r-- | clippy_utils/src/qualify_min_const_fn.rs | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/clippy_utils/src/qualify_min_const_fn.rs b/clippy_utils/src/qualify_min_const_fn.rs index 1c12da7f741..b22a9c81746 100644 --- a/clippy_utils/src/qualify_min_const_fn.rs +++ b/clippy_utils/src/qualify_min_const_fn.rs @@ -7,7 +7,7 @@ use rustc_hir as hir; use rustc_hir::def_id::DefId; use rustc_middle::mir::{ Body, CastKind, NullOp, Operand, Place, ProjectionElem, Rvalue, Statement, StatementKind, Terminator, - TerminatorKind, + TerminatorKind, NonDivergingIntrinsic }; use rustc_middle::ty::subst::GenericArgKind; use rustc_middle::ty::{self, adjustment::PointerCast, Ty, TyCtxt}; @@ -211,15 +211,19 @@ fn check_statement<'tcx>( StatementKind::SetDiscriminant { place, .. } | StatementKind::Deinit(place) => { check_place(tcx, **place, span, body) }, - StatementKind::Assume(box op) => { + + StatementKind::Intrinsic(box NonDivergingIntrinsic::Assume(op)) => { check_operand(tcx, op, span, body) }, - StatementKind::CopyNonOverlapping(box rustc_middle::mir::CopyNonOverlapping { dst, src, count }) => { + StatementKind::Intrinsic(box NonDivergingIntrinsic::CopyNonOverlapping( + rustc_middle::mir::CopyNonOverlapping { dst, src, count }, + )) => { check_operand(tcx, dst, span, body)?; check_operand(tcx, src, span, body)?; check_operand(tcx, count, span, body) }, + // These are all NOPs StatementKind::StorageLive(_) | StatementKind::StorageDead(_) |
