Skip to content

missing_docs lint does not take into account the implementing type being #[doc(hidden)] #85526

Closed

Description

I tried this code:

#![warn(missing_docs)]

//! Crate docs

#[doc(hidden)]
pub struct Foo;

impl Foo {
    pub fn bar() {}
}

I expected to see this happen: no warnings, Foo and its method are not publicly documented.

Instead, this happened:

warning: missing documentation for an associated function
 --> src/lib.rs:9:5
  |
9 |     pub fn bar() {}
  |     ^^^^^^^^^^^^
  |
note: the lint level is defined here
 --> src/lib.rs:1:9
  |
1 | #![warn(missing_docs)]
  |         ^^^^^^^^^^^^

warning: 1 warning emitted
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

A-lintArea: Lints (warnings about flaws in source code) such as unused_mut.C-bugCategory: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions