-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
Open
Labels
A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.C-bugCategory: This is a bug.Category: This is a bug.L-missing_docsLint: missing_docsLint: missing_docsT-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.Relevant to the rustdoc team, which will review and decide on the PR/issue.
Description
Hi, I'm sorry if this is not a bug, but I find it weird. The #[doc(hidden)] attribute suppresses the missing_docs lint, which is intended, but it also does it if the item is publicly reexported with #[doc(inline)].
Here is an example:
//! crate docs
#![deny(missing_docs)]
/// foo module docs
pub mod foo {
#[doc(hidden)]
/// foo struct docs
pub struct Foo {
// not documented!
pub pub bar: (),
}
/// baz docs
pub struct Baz;
}
#[doc(inline)]
pub use foo::Foo;Foo appears in the docs as if it was defined in the crate root, which is intended. However, some of it has not been documented (the field bar) since deny(missing_docs) was suppressed.
I feel like this goes against the spirit of the missing_docs lint, allowing an undocumented item in the public docs.
rustc --version --verbose:
rustc 1.86.0 (05f9846f8 2025-03-31)
binary: rustc
commit-hash: 05f9846f893b09a1be1fc8560e33fc3c815cfecb
commit-date: 2025-03-31
host: aarch64-apple-darwin
release: 1.86.0
LLVM version: 19.1.7
Metadata
Metadata
Assignees
Labels
A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.C-bugCategory: This is a bug.Category: This is a bug.L-missing_docsLint: missing_docsLint: missing_docsT-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.Relevant to the rustdoc team, which will review and decide on the PR/issue.