Cargo Workflow · 14 min · free with an account

Check, Build, Run

Lesson preview · about 30%

Choose the cheapest command that proves the next fact.

Core idea

cargo check proves type correctness without final code generation, build creates artifacts, and run executes a binary after building it.

Start with the idea

cargo check proves type correctness without final code generation, build creates artifacts, and run executes a binary after building it. Fast feedback comes from asking only for the evidence you need.

The fastest useful command depends on the question you are asking. After an edit, cargo check verifies parsing, types, borrowing, and many other compiler rules without producing a final executable. cargo test compiles the test harness and runs tests. cargo run builds a binary if needed and executes it. cargo build produces an artifact without executing it. These commands share incremental compilation work, but they provide different evidence.

A productive loop is edit, check, test the changed behavior, then run the whole program when interaction matters.

Keep learning, for free

The rest of this lesson is waiting for you.

Create a free account to read the complete explanation, see the infographic, explore the code, and try the exercises. All 742 lessons and algorithm steps are included.

No payment details. Your account opens the complete Academy.

← All lessons in Cargo & Real Projects