Skip to content

missing_docs_in_private_items warns for const _ #13427

Closed
@clarfonthey

Description

@clarfonthey

Summary

This item cannot have generated docs, so, shouldn't really be documented.

Lint Name

missing_docs_in_private_items

Reproducer

I tried this code:

#![warn(clippy::missing_docs_in_private_items)]
const _: () = {
     assert!(1 == 1);
};

I saw this happen:

warning: missing documentation for a constant
 --> src/lib.rs:2:1
  |
2 | / const _: () = {
3 | |     assert!(1 == 1);
4 | | };
  | |__^
  |
  = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_docs_in_private_items

When this shouldn't trigger at all.

Version

rustc 1.83.0-nightly (506f22b 2024-09-19)
binary: rustc
commit-hash: 506f22b
commit-date: 2024-09-19
host: x86_64-unknown-linux-gnu
release: 1.83.0-nightly
LLVM version: 19.1.0

Additional Labels

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: Clippy is not doing the correct thingI-false-positiveIssue: The lint was triggered on code it shouldn't have

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions