rust-lang/rust
Configuration
The repository's top-level configuration files, what they control, and where to look for the schema.
bootstrap.toml (your local copy of bootstrap.example.toml)
The build system's main configuration. Generated by ./x setup or written by hand. The fully-documented schema is in bootstrap.example.toml (~50 KB of # foo = … examples) and the parser is at src/bootstrap/src/core/config/.
Key sections:
| Section | Common settings |
|---|---|
[build] |
build, target, extended, docs, compiler-docs, verbose, locked-deps |
[install] |
prefix, sysconfdir, bindir, libdir |
[llvm] |
download-ci-llvm, ccache, link-shared, assertions, optimize |
[rust] |
debug, debug-assertions, incremental, parallel-compiler, lto, codegen-units, channel, download-rustc |
[dist] |
compression-formats, src-tarball, compression-profile |
[target.<TRIPLE>] |
cc, cxx, linker, ar, llvm-config, sanitizers |
change_tracker.rs (src/bootstrap/src/utils/change_tracker.rs) tracks breaking changes between bootstrap revisions; on the first invocation after a breaking change, you'll be warned about your stale config.
Cargo.toml
Two distinct Cargo workspaces in the repo:
Cargo.toml— the compiler + tools workspace (members undercompiler/,src/tools/,src/build_helper/,src/rustdoc-json-types/)library/Cargo.toml— the standard library workspace
They're separate because library crates are built with rustc-as-build-artifact + a special sysroot, and have different Cargo.lock requirements.
Excluded from the main workspace (own self-contained workspaces): compiler/rustc_codegen_cranelift, compiler/rustc_codegen_gcc, src/bootstrap, tests/rustdoc-gui, obj.
Cargo.lock files
There are multiple lockfiles, one per workspace:
Cargo.lock— main workspace lockfile (~150 KB)library/Cargo.lock— std/core/alloc/etc. dependenciessrc/bootstrap/Cargo.lock— bootstrap's own deps
All are committed; CI verifies they're not out of date.
rustfmt.toml
Project-wide format configuration. The repo's rustfmt.toml is more conservative than rustfmt's defaults: it disables some aggressive comment reformatting and enforces specific styles around imports and merge characters. Run ./x fmt to enforce.
triagebot.toml
The configuration for triagebot, the project's PR-automation bot. Lives at triagebot.toml — about 53 KB of automation rules.
What it controls:
- Label allowlists — which labels can be set by un-privileged users
- Auto-assignments — which team handles which paths (the
[assign.owners]section) - Ping groups — predefined recipient lists for
@rustbot ping <group> - Backport nominations — automatic labeling for PRs that should ship to beta/stable
- Mention rules — auto-pings when specific paths change
- FCP automation — drives Final Comment Period state machine
When in doubt about why a PR got assigned where it did, look here.
rust-bors.toml
Configuration for rust-bors, the merge queue. Lives at rust-bors.toml. Defines:
- Which CI workflows must pass before merge
- Try-build labels and behavior
- Timeout policies
- Default reviewer privileges
typos.toml
Configuration for the typos spell-checker. Lives at typos.toml. Defines accepted misspellings (technical terms, proper nouns) and a list of paths to exclude.
REUSE.toml
License metadata in REUSE format. Centralizes per-directory license info instead of requiring SPDX headers in every source file. The REUSE.toml at the repo root, plus per-subtree REUSE.toml files, are processed by tooling to produce COPYRIGHT-thirdparty.md at release time.
.editorconfig
Top-level .editorconfig for IDE formatting (tab vs. space, line endings, trailing whitespace). Most modern editors honor it.
.gitignore / .gitattributes / .mailmap
.gitignore— paths Git should ignore (build/,target/,obj/, IDE files).gitattributes— line-ending and merge-driver rules.mailmap— author-email canonicalization (39 KB; tracks contributors who've changed emails).git-blame-ignore-revs— formatting-only commits to skip ingit blame
.github/
GitHub-specific configuration:
.github/workflows/ci.yml— main CI pipeline.github/workflows/dependencies.yml— automated dep update PRs.github/workflows/post-merge.yml— runs after each merge tomain.github/workflows/ghcr.yml— Docker image publishing.github/ISSUE_TEMPLATE/— issue forms (bug, feature, ICE, perf regression, docs).github/pull_request_template.md— PR template.github/renovate.json5— Renovate config (npm/JS deps).github/FUNDING.yml— funding links
src/ci/
Beyond GitHub Actions, the heavy CI lifting happens in:
src/ci/run.sh— entrypoint inside Dockersrc/ci/docker/— Dockerfiles per CI jobsrc/ci/citool/— Rust binary that orchestrates the matrixsrc/ci/channel—nightly/beta/stable(single-line file)src/ci/scripts/— helper scripts called by Docker images
src/stage0
src/stage0 is the pin for the bootstrap stage 0 toolchain — the version of the previously-released compiler used to build the current source. About 71 KB; managed by src/tools/bump-stage0/.
The first part of the file is human-editable (server URLs, branch); the rest is generated.
package.json / yarn.lock
The repo has a small JS dependency footprint for documentation tooling (tsc, eslint) — managed by yarn, locked in yarn.lock.
bootstrap.example.toml
Not a runtime config but the documentation for bootstrap.toml. ~50 KB of fully-commented sample options. Editing this is the canonical way to document new build options.
Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.