mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-27 15:11:30 +00:00
Fix missing_docs_in_private_items FP
This commit is contained in:
parent
a248648862
commit
c21b965d43
3 changed files with 12 additions and 7 deletions
|
@ -93,9 +93,9 @@ impl MissingDoc {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
let has_doc = attrs.iter().any(|a| {
|
let has_doc = attrs
|
||||||
a.is_doc_comment() || a.doc_str().is_some() || a.value_str().is_some() || Self::has_include(a.meta())
|
.iter()
|
||||||
});
|
.any(|a| a.doc_str().is_some() || Self::has_include(a.meta()));
|
||||||
if !has_doc {
|
if !has_doc {
|
||||||
span_lint(
|
span_lint(
|
||||||
cx,
|
cx,
|
||||||
|
|
|
@ -67,7 +67,10 @@ impl PubFoo {
|
||||||
pub fn foo() {}
|
pub fn foo() {}
|
||||||
/// dox
|
/// dox
|
||||||
pub fn foo1() {}
|
pub fn foo1() {}
|
||||||
fn foo2() {}
|
#[must_use = "yep"]
|
||||||
|
fn foo2() -> u32 {
|
||||||
|
1
|
||||||
|
}
|
||||||
#[allow(clippy::missing_docs_in_private_items)]
|
#[allow(clippy::missing_docs_in_private_items)]
|
||||||
pub fn foo3() {}
|
pub fn foo3() {}
|
||||||
}
|
}
|
||||||
|
|
|
@ -94,10 +94,12 @@ LL | pub fn foo() {}
|
||||||
| ^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
error: missing documentation for an associated function
|
error: missing documentation for an associated function
|
||||||
--> $DIR/missing-doc-impl.rs:70:5
|
--> $DIR/missing-doc-impl.rs:71:5
|
||||||
|
|
|
|
||||||
LL | fn foo2() {}
|
LL | / fn foo2() -> u32 {
|
||||||
| ^^^^^^^^^^^^
|
LL | | 1
|
||||||
|
LL | | }
|
||||||
|
| |_____^
|
||||||
|
|
||||||
error: aborting due to 15 previous errors
|
error: aborting due to 15 previous errors
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue