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

missing_docs_in_private_items warns for const _ #13427

Closed
clarfonthey opened this issue Sep 20, 2024 · 0 comments · Fixed by #13573
Closed

missing_docs_in_private_items warns for const _ #13427

clarfonthey opened this issue Sep 20, 2024 · 0 comments · Fixed by #13573
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

Comments

@clarfonthey
Copy link
Contributor

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 (506f22b46 2024-09-19)
binary: rustc
commit-hash: 506f22b4663f3e756e1e6a4f66c6309fdc00819c
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

@clarfonthey clarfonthey 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 Sep 20, 2024
@bors bors closed this as completed in ddd1a86 Nov 3, 2024
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
Projects
None yet
1 participant