Fix dogfood fallout

This commit is contained in:
flip1995 2020-05-22 14:45:51 +02:00
parent c00268d984
commit 6b3cf63bf5
No known key found for this signature in database
GPG Key ID: 2CEFCDB27ED0BE79

View File

@ -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();
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;
}
},
_ => {},
// walk the associated type and check for Self
if contains_self_ty(associated_type) {
return;
}
}
}
}