You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The missing_docs lint does not do anything in test builds. Minimal code example:
#![cfg_attr(test, deny(missing_docs))]
To reproduce, make a new crate, replace src/lib.rs with the above code, and run cargo test. The command will run successfully. I would expect the command to report a “missing documentation for crate” compile error.
As for the cause, my wild guess is some sort of interaction between cfg(test) and which items are detected as public.
The text was updated successfully, but these errors were encountered:
sfackler
added
the
A-lint
Area: Lints (warnings about flaws in source code) such as unused_mut.
label
Apr 19, 2015
This is also an issue for editors that use cargo check --profile=test in order to include tests in the check. This means the lint doesn't ever fire in the editor.
It looks like the check was added in 4a5d887. I suspect the reasoning is that code inside a cfg(test) block should not be checked for missing docs, which makes sense. I think it would be nicer to allow missing_docs to run with --test, but to not check any block/module/item that is marked with cfg(test). Unfortunately, I think that is very difficult or impossible to do. 😦
The
missing_docs
lint does not do anything in test builds. Minimal code example:#![cfg_attr(test, deny(missing_docs))]
To reproduce, make a new crate, replace
src/lib.rs
with the above code, and runcargo test
. The command will run successfully. I would expect the command to report a “missing documentation for crate” compile error.As for the cause, my wild guess is some sort of interaction between
cfg(test)
and which items are detected as public.The text was updated successfully, but these errors were encountered: