Auto merge of #7281 - camsteffen:has-doc-fp, r=flip1995
Fix missing_docs_in_private_items false negative changelog: Fix [`missing_docs_in_private_items`] false negative when the item has any `#[name = "value"]` attribute Closes #7247 (decided not to use the rustc method since it calls `Session::check_name`, which is for rustc only)
This commit is contained in:
commit
2fa9362448
@ -93,9 +93,9 @@ fn check_missing_docs_attrs(
|
||||
return;
|
||||
}
|
||||
|
||||
let has_doc = attrs.iter().any(|a| {
|
||||
a.is_doc_comment() || a.doc_str().is_some() || a.value_str().is_some() || Self::has_include(a.meta())
|
||||
});
|
||||
let has_doc = attrs
|
||||
.iter()
|
||||
.any(|a| a.doc_str().is_some() || Self::has_include(a.meta()));
|
||||
if !has_doc {
|
||||
span_lint(
|
||||
cx,
|
||||
|
@ -67,7 +67,10 @@ impl PubFoo {
|
||||
pub fn foo() {}
|
||||
/// dox
|
||||
pub fn foo1() {}
|
||||
fn foo2() {}
|
||||
#[must_use = "yep"]
|
||||
fn foo2() -> u32 {
|
||||
1
|
||||
}
|
||||
#[allow(clippy::missing_docs_in_private_items)]
|
||||
pub fn foo3() {}
|
||||
}
|
||||
|
@ -94,10 +94,12 @@ LL | pub fn foo() {}
|
||||
| ^^^^^^^^^^^^^^^
|
||||
|
||||
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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user