Rust CLI Build, Run, Test, and Lint/Build tests without running them

Compile test artifacts only.

Section: Profiles and target selection

Build tests without running them

bash
bash
cargo test --no-run
Explanation

Good for CI stages or debugging compilation failures in tests.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Profiles and target selection
Build one binary target
Compile a chosen binary only.
OpenIn sheetbashsame section
Build an example target
Compile only a chosen example.
OpenIn sheetbashsame section
Check all package targets
Type-check binaries, tests, examples, and benches.
OpenIn sheetbashsame section
Run the test suite
Build and run tests for the local package.
OpenIn sheetbash2 tag match
Run a matching subset of tests
Filter tests by substring.
OpenIn sheetbash2 tag match
Show println output in tests
Pass test harness flags after `--`.
OpenIn sheetbash2 tag match