@@ -10,7 +10,7 @@ use rustc_hir::{
10
10
def:: { CtorOf , DefKind , Res } ,
11
11
def_id:: LocalDefId ,
12
12
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 ,
14
14
ItemKind , Pat , PatKind , Path , QPath , Ty , TyKind ,
15
15
} ;
16
16
use rustc_hir_analysis:: hir_ty_to_ty;
@@ -100,7 +100,8 @@ impl<'tcx> LateLintPass<'tcx> for UseSelf {
100
100
if let TyKind :: Path ( QPath :: Resolved ( _, item_path) ) = self_ty. kind;
101
101
let parameters = & item_path. segments. last( ) . expect( SEGMENTS_MSG ) . args;
102
102
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 ( _) ) )
104
105
} ) ;
105
106
if !item. span. from_expansion( ) ;
106
107
if !is_from_proc_macro( cx, item) ; // expensive, should be last check
0 commit comments