Cargo run
cargo run is a Cargo subcommand that builds and executes a Rust package’s binary target.
Learn Rust in a Month of Lunches
cargo run is a Cargo subcommand that builds and runs a Rust binary target while resolving its dependencies.
- How it is used
- Builds and runs a Rust project while bringing in the external crates its dependencies need.
- How deep it goes
- Walks through dependency-compilation output and a faster incremental rerun without detailing Cargo internals.
- Examples
- Shows a random-letter program using rand and compile logs from its initial and subsequent runs.
- What you can do after
- Operate/configure it to run a Cargo project with a declared external dependency and recognize when dependencies are recompiled.
Read how Learn Rust in a Month of Lunches explains cargo run →
Rust in Action: Systems programming concepts and techniques
cargo run is a Cargo subcommand that builds a Rust project and executes its resulting binary.
- How it is used
- Runs a Rust project while handling the build needed to produce its executable.
- How deep it goes
- Explains build output, generated files, and common flags, then exposes the compiler invocation with verbose output.
- Examples
- Uses a new Hello World project, a CSV-processing program, and a single-file project migrated to Cargo.
- What you can do after
- Operate/configure it to run a project in debug or release mode and adjust the amount of Cargo output.
Read how Rust in Action: Systems programming concepts and techniques explains cargo run →
Related concepts
- Cargopart of · Cargo is Rust’s package manager and build system for managing projects, dependencies, compilation, testing, and related workflows.
- standard errorproduces · Standard error is a process’s conventional output stream for diagnostic and error messages, separate from standard output.
- codeuses · Code is instructions or declarations expressed in a programming language that specify computational operations or software behavior.
- cargo buildalternative to · cargo build is a Cargo subcommand that resolves dependencies, compiles a Rust package, and produces its build artifacts without executing them.
- randuses · rand is a Rust library crate providing random-number generation and related randomization utilities.
- debugging modeuses · Debugging mode is a software configuration or execution state that enables diagnostic facilities for examining and troubleshooting program behavior.
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.

