Skip to content

Commit 6ce37fa

Browse files
committed
introduce PredicateAtom
1 parent 8878708 commit 6ce37fa

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

clippy_lints/src/future_not_send.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use rustc_hir::intravisit::FnKind;
33
use rustc_hir::{Body, FnDecl, HirId};
44
use rustc_infer::infer::TyCtxtInferExt;
55
use rustc_lint::{LateContext, LateLintPass};
6-
use rustc_middle::ty::{Opaque, PredicateKind::Trait};
6+
use rustc_middle::ty::{Opaque, PredicateAtom::Trait};
77
use rustc_session::{declare_lint_pass, declare_tool_lint};
88
use rustc_span::{sym, Span};
99
use rustc_trait_selection::traits::error_reporting::suggestions::InferCtxtExt;
@@ -91,7 +91,7 @@ impl<'tcx> LateLintPass<'tcx> for FutureNotSend {
9191
cx.tcx.infer_ctxt().enter(|infcx| {
9292
for FulfillmentError { obligation, .. } in send_errors {
9393
infcx.maybe_note_obligation_cause_for_async_await(db, &obligation);
94-
if let Trait(trait_pred, _) = obligation.predicate.ignore_quantifiers().skip_binder().kind() {
94+
if let Trait(trait_pred, _) = obligation.predicate.skip_binders() {
9595
db.note(&format!(
9696
"`{}` doesn't implement `{}`",
9797
trait_pred.self_ty(),

clippy_lints/src/methods/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1559,7 +1559,7 @@ impl<'tcx> LateLintPass<'tcx> for Methods {
15591559
if let ty::Opaque(def_id, _) = ret_ty.kind {
15601560
// one of the associated types must be Self
15611561
for &(predicate, _span) in cx.tcx.predicates_of(def_id).predicates {
1562-
if let ty::PredicateKind::Projection(projection_predicate) = predicate.ignore_quantifiers().skip_binder().kind() {
1562+
if let ty::PredicateAtom::Projection(projection_predicate) = predicate.skip_binders() {
15631563
// walk the associated type and check for Self
15641564
if contains_self_ty(projection_predicate.ty) {
15651565
return;

clippy_lints/src/needless_pass_by_value.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ impl<'tcx> LateLintPass<'tcx> for NeedlessPassByValue {
115115
.filter(|p| !p.is_global())
116116
.filter_map(|obligation| {
117117
// Note that we do not want to deal with qualified predicates here.
118-
if let ty::PredicateKind::Trait(pred, _) = obligation.predicate.kind() {
118+
if let ty::PredicateKind::Atom(ty::PredicateAtom::Trait(pred, _)) = obligation.predicate.kind() {
119119
if pred.def_id() == sized_trait {
120120
return None;
121121
}

clippy_lints/src/utils/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1263,7 +1263,7 @@ pub fn is_must_use_ty<'tcx>(cx: &LateContext<'tcx>, ty: Ty<'tcx>) -> bool {
12631263
ty::Tuple(ref substs) => substs.types().any(|ty| is_must_use_ty(cx, ty)),
12641264
ty::Opaque(ref def_id, _) => {
12651265
for (predicate, _) in cx.tcx.predicates_of(*def_id).predicates {
1266-
if let ty::PredicateKind::Trait(trait_predicate, _) = predicate.ignore_quantifiers().skip_binder().kind() {
1266+
if let ty::PredicateAtom::Trait(trait_predicate, _) = predicate.skip_binders() {
12671267
if must_use_attr(&cx.tcx.get_attrs(trait_predicate.trait_ref.def_id)).is_some() {
12681268
return true;
12691269
}

0 commit comments

Comments
 (0)