auto merge of #10867 : sfackler/rust/unsugared-doc, r=huonw
Closes #10853
This commit is contained in:
commit
09db61fb4f
@ -1074,7 +1074,13 @@ fn check_missing_doc_attrs(cx: &Context,
|
||||
_ => ()
|
||||
}
|
||||
|
||||
if !attrs.iter().any(|a| a.node.is_sugared_doc) {
|
||||
let has_doc = attrs.iter().any(|a| {
|
||||
match a.node.value.node {
|
||||
ast::MetaNameValue(ref name, _) if "doc" == *name => true,
|
||||
_ => false
|
||||
}
|
||||
});
|
||||
if !has_doc {
|
||||
cx.span_lint(missing_doc, sp,
|
||||
format!("missing documentation for {}", desc));
|
||||
}
|
||||
|
22
src/test/run-pass/issue-10853.rs
Normal file
22
src/test/run-pass/issue-10853.rs
Normal file
@ -0,0 +1,22 @@
|
||||
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution and at
|
||||
// http://rust-lang.org/COPYRIGHT.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
#[deny(missing_doc)];
|
||||
#[doc="module"];
|
||||
|
||||
#[doc="struct"]
|
||||
pub struct Foo;
|
||||
|
||||
pub fn foo() {
|
||||
#[doc="fn"];
|
||||
}
|
||||
|
||||
#[doc="main"]
|
||||
pub fn main() {}
|
Loading…
x
Reference in New Issue
Block a user