Run `cargo run` from a Rust project’s directory to build and execute its program. Cargo drives the Rust compiler, `rustc`, for you. If the project has not yet been built, the command compiles it first, then runs the resulting executable. section 1.3.1 section 1.6.2
Try the short path from a new project to a running program. The output separates compilation, the executable’s location, and the program’s own “Hello, world!” message. section 1.3.1
By default, the executable goes under `target/debug/`; on Windows, its name ends in `.exe`. A first run also creates Cargo-managed build artifacts, including `target/` and `Cargo.lock`. The lockfile records exact dependency versions for repeatable future builds. section 1.3.1
Change how the command builds or reports its work:
- `cargo run --release` builds an optimized executable under `target/release/`. It can run faster, although compilation takes longer. section 1.5
- `cargo run -q --release` suppresses Cargo’s progress messages, leaving the program’s output. section 1.5
- `cargo run -v` exposes more of Cargo’s work, including the `rustc` invocation when compilation occurs. section 2.1.2

