1
1
use matches:: matches;
2
2
use rustc:: hir:: map:: Map ;
3
- use rustc:: lint:: in_external_macro;
4
3
use rustc_data_structures:: fx:: { FxHashMap , FxHashSet } ;
5
4
use rustc_hir:: def:: { DefKind , Res } ;
6
5
use rustc_hir:: intravisit:: {
@@ -12,13 +11,13 @@ use rustc_hir::{
12
11
ItemKind , Lifetime , LifetimeName , ParamName , QPath , TraitBoundModifier , TraitItem , TraitItemKind , TraitMethod , Ty ,
13
12
TyKind , WhereClause , WherePredicate ,
14
13
} ;
15
- use rustc_lint:: { LateContext , LateLintPass , LintContext } ;
14
+ use rustc_lint:: { LateContext , LateLintPass } ;
16
15
use rustc_session:: { declare_lint_pass, declare_tool_lint} ;
17
16
use rustc_span:: source_map:: Span ;
18
17
use rustc_span:: symbol:: kw;
19
18
20
19
use crate :: reexport:: Name ;
21
- use crate :: utils:: { last_path_segment, span_lint, trait_ref_of_method} ;
20
+ use crate :: utils:: { in_macro , last_path_segment, span_lint, trait_ref_of_method} ;
22
21
23
22
declare_clippy_lint ! {
24
23
/// **What it does:** Checks for lifetime annotations which can be removed by
@@ -126,7 +125,7 @@ fn check_fn_inner<'a, 'tcx>(
126
125
span : Span ,
127
126
report_extra_lifetimes : bool ,
128
127
) {
129
- if in_external_macro ( cx . sess ( ) , span) || has_where_lifetimes ( cx, & generics. where_clause ) {
128
+ if in_macro ( span) || has_where_lifetimes ( cx, & generics. where_clause ) {
130
129
return ;
131
130
}
132
131
0 commit comments