Section: Environment variables

Show a backtrace on panic

bash
bash
RUST_BACKTRACE=1 cargo run
Explanation

A basic but essential debugging technique for CLI apps.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Environment variables
Pass custom compiler flags
Inject compiler flags for one build.
OpenIn sheetbashsame section
Enable Cargo debug logging
Emit tracing logs from Cargo itself.
OpenIn sheetbashsame section
Change Cargo home
Use a non-default cache and install location.
OpenIn sheetbashsame section
Create project-local Cargo config
Store configuration in the project under `.cargo/config.toml`.
Build documentation
Generate docs for the package and dependencies.
Show the dependency tree
Inspect the dependency graph for the package.