Skip to content

Commit

Permalink
Fix dogfood fallout
Browse files Browse the repository at this point in the history
  • Loading branch information
flip1995 committed May 22, 2020
1 parent c00268d commit 6b3cf63
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions clippy_lints/src/methods/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1496,17 +1496,14 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Methods {
if let ty::Opaque(def_id, _) = ret_ty.kind {
// one of the associated types must be Self
for predicate in cx.tcx.predicates_of(def_id).predicates {
match predicate.0.kind() {
ty::PredicateKind::Projection(poly_projection_predicate) => {
let binder = poly_projection_predicate.ty();
let associated_type = binder.skip_binder();

// walk the associated type and check for Self
if contains_self_ty(associated_type) {
return;
}
},
_ => {},
if let ty::PredicateKind::Projection(poly_projection_predicate) = predicate.0.kind() {
let binder = poly_projection_predicate.ty();
let associated_type = binder.skip_binder();

// walk the associated type and check for Self
if contains_self_ty(associated_type) {
return;
}
}
}
}
Expand Down

0 comments on commit 6b3cf63

Please sign in to comment.