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.tomlconsistency - 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/:
build-manifest— generates the release manifestsbump-stage0— updatessrc/stage0with a new betagenerate-copyright— producesCOPYRIGHT-thirdparty.mdlinkchecker— finds broken links in built docshtml-checker— HTML validation for rustdoc outputunicode-table-generator— regenerates Unicode tables incore::unicodereplace-version-placeholder— used at release-cut to replaceCURRENT_RUSTC_VERSIONstrings
Editor and IDE setup
- rust-analyzer — the canonical IDE backend, vendored as a submodule. Configure it on
compiler/rustc/Cargo.tomlto get IDE features inside the compiler tree (therustc.jsonprofile created by./x setupdoes this). ./x setupcan 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 atsrc/tools/rustc-perf/.-Zself-profile— built into rustc. Pair with thesummarizetool frommeasureme.cargo-bisect-rustc— for regression bisection.
Documentation builds
./x doc builds:
- The Rust Book (
src/doc/book/— submodule) - The Reference (
src/doc/reference/— submodule) - The Rustonomicon (
src/doc/nomicon/— submodule) - The rustc dev guide (
src/doc/rustc-dev-guide/— subtree) - rustdoc for
core,alloc,std,proc_macro, etc. - The unstable book (
src/doc/unstable-book/— generated) - Edition guide, embedded book, error index
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.