-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Closed
Labels
A-cargo-targetsArea: selection and definition of targets (lib, bins, examples, tests, benches)Area: selection and definition of targets (lib, bins, examples, tests, benches)A-diagnosticsArea: Error and warning messages generated by Cargo itself.Area: Error and warning messages generated by Cargo itself.C-bugCategory: bugCategory: bugE-easyExperience: EasyExperience: Easy
Description
Problem
If a crate has
[lib]
test = false
in its Cargo.toml and you run cargo check --tests
the crate always compiles regardless of what errors might actually be there.
I would expect --tests
to still fail to compile or at least emit a clear warning.
Steps
- Made a little reproduction repo:
git clone https://github.com/davidpdrsn/cargo-bug
cd cargo-bug
cargo check --tests
compilescargo check
does not compile
Notes
Output of cargo version
: cargo 1.52.0 (69767412a 2021-04-21)
Metadata
Metadata
Assignees
Labels
A-cargo-targetsArea: selection and definition of targets (lib, bins, examples, tests, benches)Area: selection and definition of targets (lib, bins, examples, tests, benches)A-diagnosticsArea: Error and warning messages generated by Cargo itself.Area: Error and warning messages generated by Cargo itself.C-bugCategory: bugCategory: bugE-easyExperience: EasyExperience: Easy