liveBook · Manning

Cargo check

cargo check is a Cargo subcommand that checks a Rust package for compilation errors without producing final executable artifacts.

How 2 Manning books explain it

Learn Rust in a Month of Lunches

cargo check is a Cargo command that analyzes a Rust package for compilation errors without producing a runnable executable.

How it is used
Checks a Rust package during active coding to learn whether it compiles without building the program.
How deep it goes
Defines the command and contrasts its faster, non-building check with compilation, but does not explain its internal analysis.
Examples
Uses cargo check during coding and contrasts it with cargo run and cargo build --release.
What you can do after
Diagnose compilation readiness during development by running cargo check before testing with cargo run.

Read how Learn Rust in a Month of Lunches explains cargo check →

Write Powerful Rust Macros

cargo check is a Cargo command that compiles a Rust project for error checking without producing a final executable.

How it is used
Uses compilation checks to catch Rust errors in macro libraries and generated code through a consuming application.
How deep it goes
Explains the boundary between library and generated-code checking, but defers full generated-code inspection to cargo expand.
Examples
Uses a misspelled TokenStream type, invalid quote! output, and a missing return in a Result-producing macro.
What you can do after
Diagnose macro errors by checking both the library and consuming application, then inspect expanded output with cargo expand.

Read how Write Powerful Rust Macros explains cargo check →

Related concepts

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.