Whitelist doc attributes

This is a bit overly permissive but should be okay for now.
This commit is contained in:
Steven Fackler 2014-05-21 19:02:40 -07:00
parent e0648093d8
commit 24f98c6d7a

View File

@ -1147,6 +1147,9 @@ fn check_attrs_usage(cx: &Context, attrs: &[ast::Attribute]) {
fn check_unused_attribute(cx: &Context, attrs: &[ast::Attribute]) {
for attr in attrs.iter() {
// whitelist docs since rustdoc looks at them
attr.check_name("doc");
if !attr::is_used(attr) {
cx.span_lint(UnusedAttribute, attr.span, "unused attribute");
}