Create project-local Cargo config
Store configuration in the project under `.cargo/config.toml`.
[build]
target-dir = "target-fast"
[term]
verbose = trueCargo supports configuration files and many keys under `.cargo/config.toml`.
Cargo configuration, environment variables, docs generation, and troubleshooting commands for Rust CLI development.
Set global or project-level Cargo configuration.
Store configuration in the project under `.cargo/config.toml`.
[build]
target-dir = "target-fast"
[term]
verbose = trueCargo supports configuration files and many keys under `.cargo/config.toml`.
cargo --config build.target-dir="target-ci" testCargo supports `--config KEY=VALUE` or a config path on the command line.
Redirect build artifacts without editing config files.
CARGO_TARGET_DIR=target-ci cargo buildUseful in CI, benchmarking, or separate debug and release workflows.
Control Cargo behavior and debugging through environment settings.
CARGO_LOG=debug cargo build`CARGO_LOG` is used for Cargo debug logging.
CARGO_HOME=$HOME/.cargo-alt cargo install ripgrepCargo home stores downloaded dependencies and install state.
RUST_BACKTRACE=1 cargo runA basic but essential debugging technique for CLI apps.
RUSTFLAGS="-D warnings" cargo checkHandy for stricter CI or low-level compiler experiments.
Generate docs and open them locally.
cargo docCargo writes docs to `target/doc`.
cargo doc --openUseful for reviewing APIs while developing.
cargo doc --no-depsOften much faster for day-to-day crate docs.
cargo rustdoc -- --document-private-itemsUseful when exploring internal APIs or custom doc generation.
Commands that help explain workspace state and resolution.
cargo treeGreat for understanding duplicate versions and feature activation.
cargo tree -i serdeHelpful when chasing why a transitive dependency exists.
cargo tree -e featuresUseful when debugging why a feature got enabled.
cargo generate-lockfileUseful in automation or before commits when a lockfile is required.
cargo updateUpdates versions recorded in `Cargo.lock` according to manifest constraints.