Skip to content

Commit

Permalink
Ignore if in_external_macro
Browse files Browse the repository at this point in the history
  • Loading branch information
Philippe-Cholet committed Jan 29, 2024
1 parent 56eaa7b commit a77a1b0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion clippy_lints/src/missing_iterator_fold.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use clippy_utils::diagnostics::span_lint;
use rustc_hir::{AssocItemKind, Impl, Item, ItemKind};
use rustc_lint::{LateContext, LateLintPass};
use rustc_lint::{LateContext, LateLintPass, LintContext};
use rustc_session::declare_lint_pass;
use rustc_span::sym;

Expand Down Expand Up @@ -53,6 +53,9 @@ declare_lint_pass!(MissingIteratorFold => [MISSING_ITERATOR_FOLD]);

impl LateLintPass<'_> for MissingIteratorFold {
fn check_item(&mut self, cx: &LateContext<'_>, item: &Item<'_>) {
if rustc_middle::lint::in_external_macro(cx.sess(), item.span) {
return;
}
if let ItemKind::Impl(Impl {
of_trait: Some(trait_ref),
..
Expand Down

0 comments on commit a77a1b0

Please sign in to comment.