Open-Source Wikis

/

Rust

/

Tools

/

Other tools

rust-lang/rust

Other tools

A tour of the user-facing tools shipped with rustup that aren't rustdoc or bootstrap, plus the long tail of in-repo support tools.

User-facing tools (vendored)

These are full external projects vendored into rust-lang/rust as either subtrees or submodules. The repo of record is upstream; rust-lang/rust periodically syncs.

miri

Lives at src/tools/miri/ (subtree from rust-lang/miri).

Miri is the Rust undefined-behavior detector. It runs your program through the same MIR interpreter that powers const fn evaluation (compiler/rustc_const_eval/), but with extra checks turned on:

  • Stacked / Tree Borrows for aliasing rules
  • Strict provenance checking
  • Data-race detection for the limited concurrency Miri supports
  • Detection of out-of-bounds reads/writes, use-after-free, uninit reads

Miri is the closest thing the language has to a formal model checker. It's slow (typically 100–1000x slower than native), so it's used on tests, not production code. Run via cargo +nightly miri run after installing the rustup component.

clippy

Lives at src/tools/clippy/ (subtree from rust-lang/rust-clippy).

Clippy is the lint collection — over 700 lints catching bugs, idiom violations, performance pitfalls, and style issues. Architecturally, it's a rustc_driver::Callbacks implementation that registers extra LateLintPasses (and a few EarlyLintPasses) before delegating compilation to the normal driver.

Lint categories: correctness (always-on), suspicious, complexity, perf, style, pedantic (opt-in), restriction (opinionated).

Lints often produce machine-applicable suggestions (cargo clippy --fix) — same suggestion infrastructure as rustc itself.

rustfmt

Lives at src/tools/rustfmt/ (subtree from rust-lang/rustfmt).

The Rust auto-formatter. Reads source, parses with the in-tree parser, then walks the AST emitting reformatted text. Configuration in rustfmt.toml is conservative by default and project-overridable.

The repo has its own rustfmt.toml with project-specific overrides; ./x fmt enforces it.

rust-analyzer

Lives at src/tools/rust-analyzer/ (submodule from rust-lang/rust-analyzer).

The IDE backend. Architecturally not an extension of rustc — it has its own analysis engine, designed for low-latency, partial-input, error-recovering analysis (rustc is built for full-program correctness, which is at odds with IDE responsiveness). Some shared crates exist (e.g., rustc_lexer, rustc_pattern_analysis are published to crates.io for rust-analyzer to consume) but the analysis is independent.

Submodule, not subtree, because rust-analyzer's release cadence is much faster than rust-lang/rust's.

cargo

Lives at src/tools/cargo/ (submodule from rust-lang/cargo).

The package manager and build tool. Submodule, not subtree — cargo is large and has its own release cadence.

Internal helper tools

tidy

src/tools/tidy/ is the repo-wide lint:

  • License header presence
  • Alphabetical ordering of marked sections
  • File-size limits
  • Banned external dependencies (extdeps.rs)
  • Trailing whitespace, tabs, line-length
  • Documentation conformance
  • Many other consistency checks

Run as ./x test tidy. Most tidy failures self-explain; some are auto-fixable with ./x test tidy --bless.

compiletest

See Compiletest.

run-make-support

src/tools/run-make-support/ is the helper library that powers tests/run-make/*/rmake.rs files. It exposes:

  • rustc(), cargo(), clang(), cc(), ld() builder structs
  • File-system helpers (copy, tmp_dir)
  • Environment helpers (target, host)
  • Assertions (assert_eq_path, assert_dyn_lib_present, …)

rmake.rs files use these to drive multi-step builds and assertions in plain Rust.

rustbook

src/tools/rustbook/ is a thin wrapper around mdBook. It builds:

error_index_generator

src/tools/error_index_generator/ builds the error index — the searchable list of EXXXX codes with their long-form explanations from compiler/rustc_error_codes/. Output served at https://doc.rust-lang.org/error_codes/.

unstable-book-gen

src/tools/unstable-book-gen/ regenerates the unstable book — the catalog of unstable language features and -Z flags — from data in compiler/rustc_feature/ and rustc_session::options.

unicode-table-generator

src/tools/unicode-table-generator/ regenerates the lookup tables in library/core/src/unicode/ from the Unicode Character Database. Run when Unicode releases a new version.

linkchecker, html-checker, jsondocck, jsondoclint

A family of validators for documentation output:

remote-test-client / remote-test-server

src/tools/remote-test-client/ and src/tools/remote-test-server/ let you run tests on a remote target machine (e.g., an embedded board). The server runs on the device; the client lives on the host. Used in CI for cross-target testing.

opt-dist

src/tools/opt-dist/ is the optimized distribution tool, used at release time. It does PGO (profile-guided optimization), BOLT (binary-layout optimization), and LTO on the shipped rustc binaries. Adds non-trivial wall-clock time but produces measurably faster compilers.

A cluster of tools used at release-cut time:

  • build-manifest — produces the rustup release manifests
  • bump-stage0 — updates src/stage0 with the new beta toolchain
  • replace-version-placeholder — replaces CURRENT_RUSTC_VERSION in source/docs
  • generate-copyright — collects license metadata into COPYRIGHT-thirdparty.md
  • collect-license-metadata — gathers per-crate license info

These run from the release-cut scripts, not in normal CI.

lld-wrapper, llvm-bitcode-linker, wasm-component-ld

Three small linker shims:

rustdoc-themes, rustdoc-gui-test, rustdoc-js, rustdoc-js-std

Tools and helpers for testing rustdoc output (HTML themes, GUI in real browsers, JS search behavior).

Other small tools

See also

Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.

Other tools – Rust wiki | Factory