Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

1.1 Rust Toolchain

Core Tools

ToolDescription
rustcThe Rust compiler. It compiles .rs source code into binary executables or libraries.
cargoThe Rust package manager and build tool. It handles project creation, building, dependency management, and running tests.
rustupThe Rust toolchain installer and version manager. It lets you install and manage multiple Rust versions and components.

Project & Dependency Tools

ToolDescription
crates.ioThe official package registry for Rust libraries. It hosts reusable packages called "crates".
Cargo.tomlThe manifest file for a Rust project. It lists metadata, dependencies, and configuration for cargo.

Testing & Formatting Tools

ToolDescription
cargo testRuns unit tests or integration tests for your Rust project.
cargo fmtAutomatically formats your code using Rust’s official style guide.
cargo clippyA linter that provides suggestions to improve code style and catch common mistakes.

Documentation

ToolDescription
rustdocGenerates HTML documentation from your Rust code using doc comments (///).
cargo docBuilds documentation for your project and its dependencies using rustdoc.

Nightly & Advanced Tools

ToolDescription
cargo benchRuns benchmark tests to measure performance. Available on nightly.
cargo expandExpands macros to show generated code. Useful for debugging procedural macros.
miriAn interpreter for Rust programs to detect undefined behavior. Works on nightly.

Toolchain Channels

ChannelDescription
stableMost reliable, updated every 6 weeks.
betaNext release candidate for stable. Used for testing.
nightlyUpdated daily, includes experimental features and tools. Needed for advanced or unstable features.