Visit attributes in one go.
This commit is contained in:
parent
8e816056a5
commit
4bb07bedf5
3 changed files with 36 additions and 45 deletions
|
@ -406,6 +406,8 @@ impl<'tcx> LateLintPass<'tcx> for UnusedAttributes {
|
|||
if !cx.sess().is_attr_used(attr) {
|
||||
debug!("emitting warning for: {:?}", attr);
|
||||
cx.struct_span_lint(UNUSED_ATTRIBUTES, attr.span, |lint| {
|
||||
// Mark as used to avoid duplicate warnings.
|
||||
cx.sess().mark_attr_used(attr);
|
||||
lint.build("unused attribute").emit()
|
||||
});
|
||||
// Is it a builtin attribute that must be used at the crate level?
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue