Skip to content

Commit 091239e

Browse files
committed
introduce newtype'd Predicate<'tcx>
1 parent 2722522 commit 091239e

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

clippy_lints/src/future_not_send.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ impl<'a, 'tcx> LateLintPass<'a, '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 {
94+
if let Trait(trait_pred, _) = obligation.predicate.kind() {
9595
let trait_ref = trait_pred.to_poly_trait_ref();
9696
db.note(&*format!(
9797
"`{}` doesn't implement `{}`",

clippy_lints/src/methods/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1496,8 +1496,8 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Methods {
14961496
if let ty::Opaque(def_id, _) = ret_ty.kind {
14971497
// one of the associated types must be Self
14981498
for predicate in cx.tcx.predicates_of(def_id).predicates {
1499-
match predicate {
1500-
(ty::PredicateKind::Projection(poly_projection_predicate), _) => {
1499+
match predicate.0.kind() {
1500+
ty::PredicateKind::Projection(poly_projection_predicate) => {
15011501
let binder = poly_projection_predicate.ty();
15021502
let associated_type = binder.skip_binder();
15031503

@@ -1506,7 +1506,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Methods {
15061506
return;
15071507
}
15081508
},
1509-
(_, _) => {},
1509+
_ => {},
15101510
}
15111511
}
15121512
}

clippy_lints/src/needless_pass_by_value.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for NeedlessPassByValue {
114114
let preds = traits::elaborate_predicates(cx.tcx, cx.param_env.caller_bounds.iter().copied())
115115
.filter(|p| !p.is_global())
116116
.filter_map(|obligation| {
117-
if let ty::PredicateKind::Trait(poly_trait_ref, _) = obligation.predicate {
117+
if let ty::PredicateKind::Trait(poly_trait_ref, _) = obligation.predicate.kind() {
118118
if poly_trait_ref.def_id() == sized_trait || poly_trait_ref.skip_binder().has_escaping_bound_vars()
119119
{
120120
return None;

clippy_lints/src/utils/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1299,7 +1299,7 @@ pub fn is_must_use_ty<'a, 'tcx>(cx: &LateContext<'a, 'tcx>, ty: Ty<'tcx>) -> boo
12991299
ty::Tuple(ref substs) => substs.types().any(|ty| is_must_use_ty(cx, ty)),
13001300
ty::Opaque(ref def_id, _) => {
13011301
for (predicate, _) in cx.tcx.predicates_of(*def_id).predicates {
1302-
if let ty::PredicateKind::Trait(ref poly_trait_predicate, _) = predicate {
1302+
if let ty::PredicateKind::Trait(ref poly_trait_predicate, _) = predicate.kind() {
13031303
if must_use_attr(&cx.tcx.get_attrs(poly_trait_predicate.skip_binder().trait_ref.def_id)).is_some() {
13041304
return true;
13051305
}

0 commit comments

Comments
 (0)