Skip to content

Proc-macro detection for clippy::missing_docs_in_private_items #12197

@daxpedda

Description

@daxpedda

Summary

clippy::missing_docs_in_private_items seems to trigger in code generated by proc-macros.

Lint Name

missing_docs_in_private_items

Reproducer

I tried this code:

//! Testing `clippy::missing_docs_in_private_items`.

#![warn(clippy::missing_docs_in_private_items)]

#[pin_project::pin_project(project_replace)]
pub struct Test {
    /// A test value.
    test: u8,
}

impl Test {
    pub fn test(&self) -> u8 {
        self.test
    }
}

I saw this happen:

warning: missing documentation for a struct field
 --> src/lib.rs:8:5
  |
8 |     test: u8,
  |     ^^^^^^^^
  |
  = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_docs_in_private_items
note: the lint level is defined here
 --> src/lib.rs:3:9
  |
3 | #![warn(clippy::missing_docs_in_private_items)]
  |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

I expected to see this happen:
No warning.

Version

rustc 1.75.0 (82e1608df 2023-12-21)
binary: rustc
commit-hash: 82e1608dfa6e0b5569232559e3d385fea5a93112
commit-date: 2023-12-21
host: x86_64-unknown-linux-gnu
release: 1.75.0
LLVM version: 17.0.6

Additional Labels

@rustbot label +T-macros

Metadata

Metadata

Assignees

Labels

C-bugCategory: Clippy is not doing the correct thingI-false-positiveIssue: The lint was triggered on code it shouldn't haveT-macrosType: Issues with macros and macro expansion

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions