Skip to content

Commit ab3c826

Browse files
Add comment about why the regular unused-attributes infrastructure
is not used for #[rustc_dirty]/#[rustc_clean].
1 parent 14191ee commit ab3c826

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/librustc_incremental/persist/dirty_clean.rs

+6
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,9 @@ pub fn check_dirty_clean_annotations<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
8989
};
9090
intravisit::walk_crate(&mut all_attrs, krate);
9191

92+
// Note that we cannot use the existing "unused attribute"-infrastructure
93+
// here, since that is running before trans. This is also the reason why
94+
// all trans-specific attributes are `Whitelisted` in syntax::feature_gate.
9295
all_attrs.report_unchecked_attrs(&dirty_clean_visitor.checked_attrs);
9396
}
9497

@@ -237,6 +240,9 @@ pub fn check_dirty_clean_metadata<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
237240
};
238241
intravisit::walk_crate(&mut all_attrs, krate);
239242

243+
// Note that we cannot use the existing "unused attribute"-infrastructure
244+
// here, since that is running before trans. This is also the reason why
245+
// all trans-specific attributes are `Whitelisted` in syntax::feature_gate.
240246
all_attrs.report_unchecked_attrs(&dirty_clean_visitor.checked_attrs);
241247
});
242248
}

0 commit comments

Comments
 (0)