Skip to content

Commit 24f98c6

Browse files
committed
Whitelist doc attributes
This is a bit overly permissive but should be okay for now.
1 parent e064809 commit 24f98c6

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/librustc/middle/lint.rs

+3
Original file line numberDiff line numberDiff line change
@@ -1147,6 +1147,9 @@ fn check_attrs_usage(cx: &Context, attrs: &[ast::Attribute]) {
11471147

11481148
fn check_unused_attribute(cx: &Context, attrs: &[ast::Attribute]) {
11491149
for attr in attrs.iter() {
1150+
// whitelist docs since rustdoc looks at them
1151+
attr.check_name("doc");
1152+
11501153
if !attr::is_used(attr) {
11511154
cx.span_lint(UnusedAttribute, attr.span, "unused attribute");
11521155
}

0 commit comments

Comments
 (0)