Skip to content

#[doc(hidden)] supresses missing_docs on #[doc(inline)]d reexports #140784

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
SLUCHABLUB opened this issue May 8, 2025 · 0 comments
Open

#[doc(hidden)] supresses missing_docs on #[doc(inline)]d reexports #140784

SLUCHABLUB opened this issue May 8, 2025 · 0 comments
Labels
T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@SLUCHABLUB
Copy link

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
@SLUCHABLUB SLUCHABLUB added the C-bug Category: This is a bug. label May 8, 2025
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label May 8, 2025
@GuillaumeGomez GuillaumeGomez added T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. and removed C-bug Category: This is a bug. needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels May 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

3 participants