Skip to content

Commit

Permalink
Auto merge of rust-lang#5293 - matthiaskrgr:macro_skip_lifetime, r=ph…
Browse files Browse the repository at this point in the history
…ansch

don't emit lifetime lint warnings for code inside macros.

Fixes rust-lang#5283

changelog: Don't emit lifetime lint warnings for code inside macros.
  • Loading branch information
bors committed Mar 30, 2020
2 parents 0a25944 + 8e83afa commit 1cac2f9
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions clippy_lints/src/lifetimes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,14 @@ use rustc_hir::{
ItemKind, Lifetime, LifetimeName, ParamName, QPath, TraitBoundModifier, TraitFn, TraitItem, TraitItemKind, Ty,
TyKind, WhereClause, WherePredicate,
};
use rustc_lint::{LateContext, LateLintPass, LintContext};
use rustc_lint::{LateContext, LateLintPass};
use rustc_middle::hir::map::Map;
use rustc_middle::lint::in_external_macro;
use rustc_session::{declare_lint_pass, declare_tool_lint};
use rustc_span::source_map::Span;
use rustc_span::symbol::kw;

use crate::reexport::Name;
use crate::utils::{last_path_segment, span_lint, trait_ref_of_method};
use crate::utils::{in_macro, last_path_segment, span_lint, trait_ref_of_method};

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

Expand Down

0 comments on commit 1cac2f9

Please sign in to comment.