Open-Source Wikis

/

Rust

/

How to contribute

/

Tooling

rust-lang/rust

Tooling

Tools shipped in this repository for contributors. Tools that ship as part of the Rust distribution (rustdoc, miri, clippy, rustfmt, rust-analyzer) are documented under Tools.

Build system: x

x, x.ps1, and x.py are wrappers that find a Python interpreter and call src/bootstrap/bootstrap.py. That script downloads the stage 0 toolchain (cached under build/cache/) and uses it to compile the Rust-based bootstrap binary, which then drives Cargo to build everything else. See Bootstrap for the full flow.

Configuration lives in bootstrap.toml; the documented options live in bootstrap.example.toml and the parser in src/bootstrap/src/core/config/.

Repo lints: tidy

src/tools/tidy/ is the project's repo-wide linter. It runs as ./x test tidy and checks:

  • License headers and REUSE.toml consistency
  • Alphabetical ordering of marked lists
  • File-size thresholds
  • Banned external dependencies (extdeps.rs)
  • Trailing whitespace, tabs, line-length
  • Several other consistency checks

If tidy fails, the failure message tells you exactly which check tripped. Most are auto-fixable.

Formatting: rustfmt

./x fmt runs the in-tree rustfmt across the workspace using rustfmt.toml. The configuration is more conservative than upstream rustfmt's defaults (e.g., it disables some aggressive comment reformatting) and is enforced on all compiler/, library/, and src/ Rust code.

Linting: clippy

./x clippy runs the in-tree clippy. Clippy is a subtree from rust-lang/rust-clippy at src/tools/clippy/. New rustc PRs do not have to be clippy-clean (the codebase has many intentional #[allow]s in performance-critical spots), but new code should not regress clippy.

Typo detection: typos

typos.toml configures the typos tool, which catches misspellings. CI runs it; you can run it locally with cargo install typos-cli && typos.

Test runner: compiletest

src/tools/compiletest/ parses the directives at the top of each test file (//@ compile-flags: …) and runs rustc with the right inputs, comparing output against .stderr / .stdout snapshots. See Testing.

Bootstrap helpers

A long tail of helper crates lives under src/tools/:

Editor and IDE setup

  • rust-analyzer — the canonical IDE backend, vendored as a submodule. Configure it on compiler/rustc/Cargo.toml to get IDE features inside the compiler tree (the rustc.json profile created by ./x setup does this).
  • ./x setup can install a git pre-push hook that runs tidy + format check, catching the most common CI failures locally.

CI: GitHub Actions + Docker

Top-level CI is GitHub Actions (.github/workflows/ci.yml) but most jobs delegate to Docker images defined in src/ci/docker/ and run via src/ci/run.sh. Job orchestration is done in Rust by the citool binary.

The CI matrix covers:

  • All tier 1 platforms (Linux, macOS, Windows, multiple architectures)
  • Cross-compilation builds for many tier 2 targets
  • Special configurations: ASan, MSan, TSan, debug-assertions, coverage
  • Documentation builds
  • Tooling tests (rustfmt, clippy, miri, rustdoc-gui)

Each PR runs a fast subset on push; the merge queue runs the full matrix. The complete CI manifest is generated by citool.

Bots and merge automation

Bot Where configured What it does
bors / rust-bors rust-bors.toml Merge queue
triagebot triagebot.toml PR assignment, labels, FCP, ping groups, glossary mentions
rustbot (server-side) Rollups, status pings
renovate .github/renovate.json5 npm/JS deps
dependabot (server-side) Security advisories

If a bot misbehaves, the team contact is T-infra on Zulip.

Performance tooling

  • rustc-perf — the benchmark suite. Submodule at src/tools/rustc-perf/.
  • -Zself-profile — built into rustc. Pair with the summarize tool from measureme.
  • cargo-bisect-rustc — for regression bisection.

Documentation builds

./x doc builds:

Each book is built with rustbook, a thin wrapper around mdBook.

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

Tooling – Rust wiki | Factory