@@ -10,7 +10,7 @@ use rustc_hir::{
1010 def:: { CtorOf , DefKind , Res } ,
1111 def_id:: LocalDefId ,
1212 intravisit:: { walk_inf, walk_ty, Visitor } ,
13- Expr , ExprKind , FnRetTy , FnSig , GenericArg , GenericParam , GenericParamKind , HirId , Impl , ImplItemKind , Item ,
13+ Expr , ExprKind , FnRetTy , FnSig , GenericArg , GenericArgsParentheses , GenericParam , GenericParamKind , HirId , Impl , ImplItemKind , Item ,
1414 ItemKind , Pat , PatKind , Path , QPath , Ty , TyKind ,
1515} ;
1616use rustc_hir_analysis:: hir_ty_to_ty;
@@ -100,7 +100,8 @@ impl<'tcx> LateLintPass<'tcx> for UseSelf {
100100 if let TyKind :: Path ( QPath :: Resolved ( _, item_path) ) = self_ty. kind;
101101 let parameters = & item_path. segments. last( ) . expect( SEGMENTS_MSG ) . args;
102102 if parameters. as_ref( ) . map_or( true , |params| {
103- !params. parenthesized && !params. args. iter( ) . any( |arg| matches!( arg, GenericArg :: Lifetime ( _) ) )
103+ params. parenthesized == GenericArgsParentheses :: No
104+ && !params. args. iter( ) . any( |arg| matches!( arg, GenericArg :: Lifetime ( _) ) )
104105 } ) ;
105106 if !item. span. from_expansion( ) ;
106107 if !is_from_proc_macro( cx, item) ; // expensive, should be last check
0 commit comments