File tree 2 files changed +29
-1
lines changed
2 files changed +29
-1
lines changed Original file line number Diff line number Diff line change @@ -1074,7 +1074,13 @@ fn check_missing_doc_attrs(cx: &Context,
1074
1074
_ => ( )
1075
1075
}
1076
1076
1077
- if !attrs. iter ( ) . any ( |a| a. node . is_sugared_doc ) {
1077
+ let has_doc = attrs. iter ( ) . any ( |a| {
1078
+ match a. node . value . node {
1079
+ ast:: MetaNameValue ( ref name, _) if "doc" == * name => true ,
1080
+ _ => false
1081
+ }
1082
+ } ) ;
1083
+ if !has_doc {
1078
1084
cx. span_lint ( missing_doc, sp,
1079
1085
format ! ( "missing documentation for {}" , desc) ) ;
1080
1086
}
Original file line number Diff line number Diff line change
1
+ // Copyright 2013 The Rust Project Developers. See the COPYRIGHT
2
+ // file at the top-level directory of this distribution and at
3
+ // http://rust-lang.org/COPYRIGHT.
4
+ //
5
+ // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6
+ // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7
+ // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8
+ // option. This file may not be copied, modified, or distributed
9
+ // except according to those terms.
10
+
11
+ #[ deny( missing_doc) ] ;
12
+ #[ doc="module" ] ;
13
+
14
+ #[ doc="struct" ]
15
+ pub struct Foo ;
16
+
17
+ pub fn foo ( ) {
18
+ #[ doc="fn" ] ;
19
+ }
20
+
21
+ #[ doc="main" ]
22
+ pub fn main ( ) { }
You can’t perform that action at this time.
0 commit comments