You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
abonander opened this issue
Jan 11, 2019
· 5 comments
Labels
A-lintArea: Lints (warnings about flaws in source code) such as unused_mut.C-bugCategory: This is a bug.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.
This one might be a bit complex to solve. This affects both 2015 and 2018 editions on stable/nightly.
When a pub item from a private module in a crate with #![deny(missing_docs)] is reexported in a pub module marked #![allow(missing_docs)], the lint still fires.
2015 (Playground) (2018 just needs the crate:: prefix on the use path)
//! docs for crate#![deny(missing_docs)]#[allow(missing_docs)]pubmod undoc {#[allow(missing_docs)]// no effectpubuse nonpub::Foo;}mod nonpub {pubstructFoo;implFoo{pubfnbar(){}}}
Both report the same error. The lint marks the original definition point of the item; if it has associated items, those are hit too:
error: missing documentation for a struct
--> src/lib.rs:11:5
|
11 | pub struct Foo;
| ^^^^^^^^^^^^^^^
|
note: lint level defined here
--> src/lib.rs:2:9
|
2 | #![deny(missing_docs)]
| ^^^^^^^^^^^^
error: missing documentation for a method
--> src/lib.rs:14:9
|
14 | pub fn bar() {}
| ^^^^^^^^^^^^
error: aborting due to 2 previous errors
Interestingly, marking the item's source module with #[allow(missing_docs)] silences the error: Playground
//! docs for crate#![deny(missing_docs)]#[allow(missing_docs)]pubmod undoc {pubuse nonpub::Foo;}#[allow(missing_docs)]mod nonpub {pubstructFoo;implFoo{pubfnbar(){}}}
The text was updated successfully, but these errors were encountered:
@estebank this is a lint error, not a Rustdoc error
estebank
added
A-lint
Area: Lints (warnings about flaws in source code) such as unused_mut.
and removed
T-rustdoc
Relevant to the rustdoc team, which will review and decide on the PR/issue.
labels
Jan 12, 2019
struct Foo and fn bar are 1) reachable from other crates, 2) have no doc comments and 3) are not in scope of #[allow(missing_docs)].
So they are reported by the missing doc lint.
Except that they're reexported from a module marked #[allow(missing_docs)] which I would expect not to require documentation on items reachable inside it.
Moreover, #[allow(missing_docs)] on the reexport does nothing but is not at least marked as an unused attribute.
Enselic
added
T-rustdoc
Relevant to the rustdoc team, which will review and decide on the PR/issue.
C-bug
Category: This is a bug.
labels
Nov 18, 2023
A-lintArea: Lints (warnings about flaws in source code) such as unused_mut.C-bugCategory: This is a bug.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.
This one might be a bit complex to solve. This affects both 2015 and 2018 editions on stable/nightly.
When a
pub
item from a private module in a crate with#![deny(missing_docs)]
is reexported in a pub module marked#![allow(missing_docs)]
, the lint still fires.2015 (Playground) (2018 just needs the
crate::
prefix on theuse
path)Both report the same error. The lint marks the original definition point of the item; if it has associated items, those are hit too:
Interestingly, marking the item's source module with
#[allow(missing_docs)]
silences the error: PlaygroundThe text was updated successfully, but these errors were encountered: