Skip to content

Commit 8e83afa

Browse files
committed
don't emit lifetime lints for code inside macros.
Fixes rust-lang#5283
1 parent e170c84 commit 8e83afa

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

clippy_lints/src/lifetimes.rs

+3-4
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,14 @@ use rustc_hir::{
99
ItemKind, Lifetime, LifetimeName, ParamName, QPath, TraitBoundModifier, TraitFn, TraitItem, TraitItemKind, Ty,
1010
TyKind, WhereClause, WherePredicate,
1111
};
12-
use rustc_lint::{LateContext, LateLintPass, LintContext};
12+
use rustc_lint::{LateContext, LateLintPass};
1313
use rustc_middle::hir::map::Map;
14-
use rustc_middle::lint::in_external_macro;
1514
use rustc_session::{declare_lint_pass, declare_tool_lint};
1615
use rustc_span::source_map::Span;
1716
use rustc_span::symbol::kw;
1817

1918
use crate::reexport::Name;
20-
use crate::utils::{last_path_segment, span_lint, trait_ref_of_method};
19+
use crate::utils::{in_macro, last_path_segment, span_lint, trait_ref_of_method};
2120

2221
declare_clippy_lint! {
2322
/// **What it does:** Checks for lifetime annotations which can be removed by
@@ -125,7 +124,7 @@ fn check_fn_inner<'a, 'tcx>(
125124
span: Span,
126125
report_extra_lifetimes: bool,
127126
) {
128-
if in_external_macro(cx.sess(), span) || has_where_lifetimes(cx, &generics.where_clause) {
127+
if in_macro(span) || has_where_lifetimes(cx, &generics.where_clause) {
129128
return;
130129
}
131130

0 commit comments

Comments
 (0)