mirror of
https://github.com/rust-lang/rust-clippy
synced 2025-02-25 03:47:18 +00:00
Generalize the Assume intrinsic statement to a general Intrinsic statement
This commit is contained in:
parent
e1b3483ee8
commit
9cbbd4a80e
1 changed files with 7 additions and 3 deletions
|
@ -7,7 +7,7 @@ use rustc_hir as hir;
|
||||||
use rustc_hir::def_id::DefId;
|
use rustc_hir::def_id::DefId;
|
||||||
use rustc_middle::mir::{
|
use rustc_middle::mir::{
|
||||||
Body, CastKind, NullOp, Operand, Place, ProjectionElem, Rvalue, Statement, StatementKind, Terminator,
|
Body, CastKind, NullOp, Operand, Place, ProjectionElem, Rvalue, Statement, StatementKind, Terminator,
|
||||||
TerminatorKind,
|
TerminatorKind, NonDivergingIntrinsic
|
||||||
};
|
};
|
||||||
use rustc_middle::ty::subst::GenericArgKind;
|
use rustc_middle::ty::subst::GenericArgKind;
|
||||||
use rustc_middle::ty::{self, adjustment::PointerCast, Ty, TyCtxt};
|
use rustc_middle::ty::{self, adjustment::PointerCast, Ty, TyCtxt};
|
||||||
|
@ -211,15 +211,19 @@ fn check_statement<'tcx>(
|
||||||
StatementKind::SetDiscriminant { place, .. } | StatementKind::Deinit(place) => {
|
StatementKind::SetDiscriminant { place, .. } | StatementKind::Deinit(place) => {
|
||||||
check_place(tcx, **place, span, body)
|
check_place(tcx, **place, span, body)
|
||||||
},
|
},
|
||||||
StatementKind::Assume(box op) => {
|
|
||||||
|
StatementKind::Intrinsic(box NonDivergingIntrinsic::Assume(op)) => {
|
||||||
check_operand(tcx, op, span, body)
|
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, dst, span, body)?;
|
||||||
check_operand(tcx, src, span, body)?;
|
check_operand(tcx, src, span, body)?;
|
||||||
check_operand(tcx, count, span, body)
|
check_operand(tcx, count, span, body)
|
||||||
},
|
},
|
||||||
|
|
||||||
// These are all NOPs
|
// These are all NOPs
|
||||||
StatementKind::StorageLive(_)
|
StatementKind::StorageLive(_)
|
||||||
| StatementKind::StorageDead(_)
|
| StatementKind::StorageDead(_)
|
||||||
|
|
Loading…
Add table
Reference in a new issue