]> git.lizzy.rs Git - rust.git/commitdiff
Whitelist doc attributes
authorSteven Fackler <sfackler@gmail.com>
Thu, 22 May 2014 02:02:40 +0000 (19:02 -0700)
committerSteven Fackler <sfackler@gmail.com>
Sat, 24 May 2014 23:49:46 +0000 (16:49 -0700)
This is a bit overly permissive but should be okay for now.

src/librustc/middle/lint.rs

index 5f7376396e4a1966ab9802d98f7197e8593bebb1..5315b223344c24c65b3db317c99005fcf025d8ce 100644 (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");
         }