Skip to content

Commit 90a562c

Browse files
committed
Deduplicate unchecked_attrs errors.
1 parent 2658fb7 commit 90a562c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

compiler/rustc_incremental/src/persist/dirty_clean.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ pub fn check_dirty_clean_annotations(tcx: TyCtxt<'_>) {
168168
// Note that we cannot use the existing "unused attribute"-infrastructure
169169
// here, since that is running before codegen. This is also the reason why
170170
// all codegen-specific attributes are `AssumedUsed` in rustc_ast::feature_gate.
171-
all_attrs.report_unchecked_attrs(&dirty_clean_visitor.checked_attrs);
171+
all_attrs.report_unchecked_attrs(dirty_clean_visitor.checked_attrs);
172172
})
173173
}
174174

@@ -535,13 +535,14 @@ impl FindAllAttrs<'_, 'tcx> {
535535
false
536536
}
537537

538-
fn report_unchecked_attrs(&self, checked_attrs: &FxHashSet<ast::AttrId>) {
538+
fn report_unchecked_attrs(&self, mut checked_attrs: FxHashSet<ast::AttrId>) {
539539
for attr in &self.found_attrs {
540540
if !checked_attrs.contains(&attr.id) {
541541
self.tcx.sess.span_err(
542542
attr.span,
543543
"found unchecked `#[rustc_dirty]` / `#[rustc_clean]` attribute",
544544
);
545+
checked_attrs.insert(attr.id);
545546
}
546547
}
547548
}

0 commit comments

Comments
 (0)