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 →

Also covered in

What to know first

Related concepts

Questions about cargo check

What is cargo check?

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

Which Manning books explain cargo check?

Learn Rust in a Month of Lunches and Write Powerful Rust Macros.

What should I know before learning cargo check?

Manning books that teach cargo check usually introduce Rust first.

What is the difference between cargo check and cargo build?

cargo check is a Cargo subcommand that checks a Rust package for compilation errors without producing final executable artifacts. cargo build is a Cargo command that compiles a Rust package and produces build artifacts without running them.

What is cargo check part of?

Cargo check is part of Cargo. Cargo is Rust’s package manager and build tool for managing projects and dependencies and for building, testing, and running Rust code.

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.