Skip to content

Commit a77a1b0

Browse files
Ignore if in_external_macro
1 parent 56eaa7b commit a77a1b0

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

clippy_lints/src/missing_iterator_fold.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use clippy_utils::diagnostics::span_lint;
22
use rustc_hir::{AssocItemKind, Impl, Item, ItemKind};
3-
use rustc_lint::{LateContext, LateLintPass};
3+
use rustc_lint::{LateContext, LateLintPass, LintContext};
44
use rustc_session::declare_lint_pass;
55
use rustc_span::sym;
66

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

5454
impl LateLintPass<'_> for MissingIteratorFold {
5555
fn check_item(&mut self, cx: &LateContext<'_>, item: &Item<'_>) {
56+
if rustc_middle::lint::in_external_macro(cx.sess(), item.span) {
57+
return;
58+
}
5659
if let ItemKind::Impl(Impl {
5760
of_trait: Some(trait_ref),
5861
..

0 commit comments

Comments
 (0)