@@ -18,7 +18,7 @@ use rustc_lint::{LateContext, LateLintPass, Lint, LintContext};
1818use rustc_middle:: hir:: map:: Map ;
1919use rustc_middle:: lint:: in_external_macro;
2020use rustc_middle:: ty:: subst:: GenericArgKind ;
21- use rustc_middle:: ty:: { self , Predicate , Ty } ;
21+ use rustc_middle:: ty:: { self , Ty } ;
2222use rustc_session:: { declare_lint_pass, declare_tool_lint} ;
2323use rustc_span:: source_map:: Span ;
2424use rustc_span:: symbol:: { sym, SymbolStr } ;
@@ -1496,17 +1496,14 @@ 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- ( Predicate :: Projection ( poly_projection_predicate) , _) => {
1501- let binder = poly_projection_predicate. ty ( ) ;
1502- let associated_type = binder. skip_binder ( ) ;
1503-
1504- // walk the associated type and check for Self
1505- if contains_self_ty ( associated_type) {
1506- return ;
1507- }
1508- } ,
1509- ( _, _) => { } ,
1499+ if let ty:: PredicateKind :: Projection ( poly_projection_predicate) = predicate. 0 . kind ( ) {
1500+ let binder = poly_projection_predicate. ty ( ) ;
1501+ let associated_type = binder. skip_binder ( ) ;
1502+
1503+ // walk the associated type and check for Self
1504+ if contains_self_ty ( associated_type) {
1505+ return ;
1506+ }
15101507 }
15111508 }
15121509 }
0 commit comments