Summary
When check-private-items = true is set in clippy.toml, missing_errors_doc warnings can appear on test functions, even though there's no reason to document the meanings of errors returned by test functions, since these errors won't used by other code.
Lint Name
missing_errors_doc
Reproducer
I tried this code:
#[warn(clippy::missing_errors_doc)]
#[test]
fn test() -> Result<(), ()> {
Ok(())
}
I saw this happen:
warning: docs for function returning `Result` missing `# Errors` section
--> src/main.rs:7:1
|
7 | fn test() -> Result<(), ()> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
note: the lint level is defined here
--> src/main.rs:5:8
|
5 | #[warn(clippy::missing_errors_doc)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
I expected to see this happen:
No warning.
Version
rustc 1.81.0 (eeb90cda1 2024-09-04)
binary: rustc
commit-hash: eeb90cda1969383f56a2637cbd3037bdf598841c
commit-date: 2024-09-04
host: x86_64-pc-windows-msvc
release: 1.81.0
LLVM version: 18.1.7
Additional Labels
No response
Summary
When
check-private-items = trueis set inclippy.toml,missing_errors_docwarnings can appear on test functions, even though there's no reason to document the meanings of errors returned by test functions, since these errors won't used by other code.Lint Name
missing_errors_doc
Reproducer
I tried this code:
I saw this happen:
I expected to see this happen:
No warning.
Version
Additional Labels
No response