{{~*set command=“check”}} {{~*set actionverb=“Check”}} {{~*set multitarget=true}}
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-target-triple }}
{{> options-release }}
{{> options-profile-legacy-check }}
{{> options-timings }}
{{/options}}
{} {{> options-target-dir }} {{/options}}
{{> options-message-format }} {{/options}}
{} {{> options-manifest-path }}
{{> options-ignore-rust-version }}
{{> options-locked }}
{{> options-lockfile-path }} {{/options}}
{{> section-options-common }}
{} {{> options-jobs }} {{> options-keep-going }} {{> 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}}