Add comment about why the regular unused-attributes infrastructure
is not used for #[rustc_dirty]/#[rustc_clean].
This commit is contained in:
parent
14191eed41
commit
ab3c8269f4
1 changed files with 6 additions and 0 deletions
|
|
@ -89,6 +89,9 @@ pub fn check_dirty_clean_annotations<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
|
|||
};
|
||||
intravisit::walk_crate(&mut all_attrs, krate);
|
||||
|
||||
// Note that we cannot use the existing "unused attribute"-infrastructure
|
||||
// here, since that is running before trans. This is also the reason why
|
||||
// all trans-specific attributes are `Whitelisted` in syntax::feature_gate.
|
||||
all_attrs.report_unchecked_attrs(&dirty_clean_visitor.checked_attrs);
|
||||
}
|
||||
|
||||
|
|
@ -237,6 +240,9 @@ pub fn check_dirty_clean_metadata<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
|
|||
};
|
||||
intravisit::walk_crate(&mut all_attrs, krate);
|
||||
|
||||
// Note that we cannot use the existing "unused attribute"-infrastructure
|
||||
// here, since that is running before trans. This is also the reason why
|
||||
// all trans-specific attributes are `Whitelisted` in syntax::feature_gate.
|
||||
all_attrs.report_unchecked_attrs(&dirty_clean_visitor.checked_attrs);
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue