Open-Source Wikis

/

Rust

/

Reference

/

Configuration

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 under compiler/, 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:

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 in git blame

.github/

GitHub-specific configuration:

src/ci/

Beyond GitHub Actions, the heavy CI lifting happens in:

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.

Configuration – Rust wiki | Factory