Open
Description
Problem
The command cargo check --all-targets
does not compile doctests.
Steps
- Add a doctest to a project with a syntax error in it.
- Run
cargo check --all-targets
, which should "Check all targets" according to--help
- Observe that the error in the doctest is not reported.
Notes
I suspect this has been known for some time (#4592 (comment)). Combined with #5242, this means that there is no way to check the code in a doctest without running it (and using cargo test
). From memory, I think that's because doctests are very different from all other code and tests, but I think it's surprising enough (I keep re-discovering this even now!) that it should probably be fixed.
Output of cargo version
: cargo 1.32.0-nightly (b3d0b2e54 2018-11-15)
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
No status