Skip to content
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

Proc-macro detection for clippy::missing_docs_in_private_items #12197

Closed
daxpedda opened this issue Jan 25, 2024 · 1 comment · Fixed by #12433
Closed

Proc-macro detection for clippy::missing_docs_in_private_items #12197

daxpedda opened this issue Jan 25, 2024 · 1 comment · Fixed by #12433
Assignees
Labels
C-bug Category: Clippy is not doing the correct thing I-false-positive Issue: The lint was triggered on code it shouldn't have T-macros Type: Issues with macros and macro expansion

Comments

@daxpedda
Copy link
Contributor

daxpedda commented Jan 25, 2024

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

@daxpedda daxpedda added C-bug Category: Clippy is not doing the correct thing I-false-positive Issue: The lint was triggered on code it shouldn't have labels Jan 25, 2024
@rustbot rustbot added the T-macros Type: Issues with macros and macro expansion label Jan 25, 2024
@J-ZhengLi
Copy link
Member

@rustbot claim

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: Clippy is not doing the correct thing I-false-positive Issue: The lint was triggered on code it shouldn't have T-macros Type: Issues with macros and macro expansion
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants