rust-lang / rust-lang/rust-clippy
`#[expect(clippy::missing_docs_in_private_items)]` causes `unfulfilled_lint_expectations` when building tests
Open
@Kokoro2336 is already working on this.
Since Apr 30, 2026.
C-bug
I-false-negative
- Dominant language
- Rust
- Stars
- 13.5k
- Forks
- 2.2k
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 32
Description
Summary
The same as https://github.com/rust-lang/rust/issues/130021; Clippy inherited this code from rustc:
rustc removed it in https://github.com/rust-lang/rust/pull/130025, which fixed missing_docs, but clippy::missing_docs_in_private_items has not picked that up.
(I don’t know whether this counts as a false negative or a false positive…)
Lint Name
missing_docs_in_private_items
Reproducer
I tried this code:
#![warn(clippy::missing_docs_in_private_items)]
pub fn public() {
private();
}
#[expect(clippy::missing_docs_in_private_items)]
fn private() {}
I expected to see this happen:
shion:/v/f/1/j/T/tmp.xdpOLKV5bl/clippy-bug-reproducer
❭ cargo clippy --all-targets
Checking clippy-bug-reproducer v0.1.0 (/private/var/folders/1v/jtp_4pzx7xq371f8j_xdnrvm0000gn/T/tmp.xdpOLKV5bl/clippy-bug-reproducer)
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.10s
Instead, this happened:
shion:/v/f/1/j/T/tmp.xdpOLKV5bl/clippy-bug-reproducer
❭ cargo clippy --all-targets
Checking clippy-bug-reproducer v0.1.0 (/private/var/folders/1v/jtp_4pzx7xq371f8j_xdnrvm0000gn/T/tmp.xdpOLKV5bl/clippy-bug-reproducer)
warning: this lint expectation is unfulfilled
--> src/lib.rs:7:10
|
7 | #[expect(clippy::missing_docs_in_private_items)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(unfulfilled_lint_expectations)]` on by default
warning: `clippy-bug-reproducer` (lib test) generated 1 warning
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.12s
Version
rustc 1.94.0 (4a4ef493e 2026-03-02) (built from a source tarball)
binary: rustc
commit-hash: 4a4ef493e3a1488c6e321570238084b38948f6db
commit-date: 2026-03-02
host: aarch64-apple-darwin
release: 1.94.0
LLVM version: 21.1.8
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.