{{*set actionverb="Check"}}
cargo-check - Check the current package
cargo check
[options]
Check a local package and all of its dependencies for errors. This
will essentially compile the packages without performing the final step
of code generation, which is faster than running
cargo build
. The compiler will save metadata files to disk
so that future runs will reuse them if the source has not been modified.
Some diagnostics and errors are only emitted during code generation, so
they inherently won't be reported with cargo check
.
{{> section-package-selection }}
When no target selection options are given, cargo check
will check all binary and library targets of the selected packages.
Binaries are skipped if they have required-features
that
are missing.
{{> options-targets }}
{{> section-features }}
{{#options}}
{{> options-target-triple }}
{{> options-release }}
{{> options-profile-legacy-check }}
{{> options-ignore-rust-version }}
{{> options-timings }}
{{/options}}
{{#options}} {{> options-target-dir }} {{/options}}
{{#options}} {{> options-display }}
{{> options-message-format }} {{/options}}
{{#options}} {{> options-manifest-path }}
{{> options-locked }} {{/options}}
{{> section-options-common }}
{{#options}} {{> options-jobs }} {{> options-future-incompat }} {{/options}}
{{> section-environment }}
{{> section-exit-status }}
Check the local package for errors:
cargo check
Check all targets, including unit tests:
cargo check --all-targets --profile=test
{{man "cargo" 1}}, {{man "cargo-build" 1}}