rust-lang/rust
Lore
A narrative timeline of the rust-lang/rust codebase. For per-crate technical detail see Architecture; for current statistics see By the numbers.
Dates below are derived from git history, release tags, and
RELEASES.md. Where the why of a change isn't clear, hedging language is used.
Eras
The OCaml prehistory (2006 – 2010)
Rust began as Graydon Hoare's personal project in 2006. The earliest compiler was written in OCaml, not Rust — that compiler is gone from this repository, but many of the project's founding ideas (algebraic data types, pattern matching, fearless concurrency) date from this era.
The self-hosting era (2010 – 2014)
In 2010 the OCaml compiler was retired and replaced with a self-hosted compiler written in Rust. Mozilla announced its sponsorship the same year. From here, every release of rustc was built by the previous release — the "stage 0 → stage 1 → stage 2" bootstrap dance documented in src/bootstrap/README.md is a direct descendant of that decision.
The pre-1.0 era was characterized by aggressive language churn: ~T and @T (sigil-based ownership) gave way to Box<T> and Rc<T>, the green-threading runtime was removed, and the entire standard library was repeatedly reorganized.
Rust 1.0 (May 2015)
Rust 1.0 shipped on 15 May 2015 with the strong stability promise that has defined the project ever since: a six-week release train with no breaking changes on stable. The release branched off master and went through beta for six weeks before becoming stable. That cadence has held to this day. See RELEASES.md for the running record.
MIR and NLL (2015 – 2018)
The mid-level IR (MIR) was introduced in mid-2015 and progressively became the basis for borrow checking and codegen. The crate rustc_mir_* family in this repo (rustc_mir_build, rustc_mir_dataflow, rustc_mir_transform, rustc_const_eval) all date from or grew out of this period.
Non-Lexical Lifetimes (NLL) — a re-formulation of the borrow checker that allows borrows to end before the end of their lexical scope — landed for the 2018 edition. The work lives on in compiler/rustc_borrowck/ and is now simply "the borrow checker"; the term "NLL" survives in test paths and in -Z flags.
Editions (2018, 2021, 2024)
Editions are the project's mechanism for opt-in language updates:
| Edition | Released | Notable changes |
|---|---|---|
| 2015 | (Rust 1.0) | The original |
| 2018 | Dec 2018 | Module path changes, async/await infrastructure, dyn Trait, ? everywhere |
| 2021 | Oct 2021 | Closure capture changes, IntoIterator for arrays, panic macro consistency |
| 2024 | Feb 2025 | RPIT lifetime capture rules, gen blocks (unstable), unsafe extern |
Each edition is a crate-level opt-in: cargo new defaults to the latest, but old crates keep compiling. The infrastructure for this lives in compiler/rustc_feature/ and the parser/resolver.
async/await stabilization (2019)
Stable async/await shipped in November 2019 (Rust 1.39). The necessary infrastructure spans many crates: a Future trait in core, generators in MIR, the trait solver, and the executor abstraction left to user libraries. See library/core/src/future/ for the language-level types.
The const-eval and CTFE expansion (2018 – ongoing)
What started as evaluating simple const expressions grew into a full MIR interpreter (compiler/rustc_const_eval/). The same engine now powers const fn evaluation, pattern matching on const values, and Miri (src/tools/miri/) — Rust's undefined-behavior detector. Const generics (const N: usize) stabilized in Rust 1.51 (March 2021) and continue to grow.
The Mozilla → Foundation transition (2020 – 2021)
In August 2020 Mozilla laid off most of its Rust team. The project survived because it was already governed by an independent team structure, but the transition led to the founding of the Rust Foundation in February 2021, which now provides legal/financial support. None of this is visible in the repository's code, but commit cadence dipped briefly in late 2020 before recovering.
The new trait solver and Polonius (2022 – ongoing)
Two long-running rewrites are visible in the tree:
rustc_next_trait_solver— a from-scratch reimplementation of trait solving, designed to be sound, faster, and to support coherence checking inside the solver. Lives behind-Znext-solverand is being incrementally enabled.- Polonius — a Datalog-based reformulation of NLL. Implemented in an external crate; rustc has hooks under
rustc_borrowckto feed it. Still experimental.
Alternative codegen backends (2018 – ongoing)
The LLVM backend lives in compiler/rustc_codegen_llvm/ and shared codegen logic in rustc_codegen_ssa. Two alternative backends grew up alongside it:
rustc_codegen_cranelift(compiler/rustc_codegen_cranelift/) — fast debug-mode codegen via Cranelift. Has its own out-of-line build setup.rustc_codegen_gcc(compiler/rustc_codegen_gcc/) — a GCC backend (vialibgccjit) for platforms LLVM doesn't support.
Backends are loaded as dynamic libraries at compiler startup, selected via -Zcodegen-backend.
Longest-standing features
- Cargo workspace layout — the
Cargo.tomlat the repo root has been the workspace anchor since the workspace feature itself was introduced; the structure is conceptually unchanged for years. x.pybootstrap entry point — predates Cargo workspaces. Has weathered the move from Make to Python to Rust (the bootstrap binary is now itself written in Rust undersrc/bootstrap/, withbootstrap.pyonly as the pre-rustc downloader).compiletest— the test harness insrc/tools/compiletest/has been the test driver since well before 1.0; the directives format (//@ compile-flags: …) is largely backward-compatible.- Tidy — the repo-wide lint in
src/tools/tidy/catches license headers, file size limits, alphabetical ordering, etc. Also old.
Deprecated / removed features
- Green-threading runtime — pre-1.0 Rust had M:N green threads in
libgreen. Removed before 1.0; today'sstd::threadis 1:1 OS threads. ~Tand@Tsigils — pre-1.0 ownership/garbage-collection sigils, replaced byBox<T>and (eventually)Rc<T>.#[derive(Encodable, Decodable)]— old Rustc-internal serialization, fully replaced byserdefor user code (the in-treerustc_serializecrate is internal to rustc).#[deriving(...)]— pre-1.0 attribute name, became#[derive(...)]before 1.0.extern cratedeclarations — still legal but largely obsolete since the 2018 edition; module paths now work without them in normal user code.try!macro — replaced by the?operator in 2018; deprecated.std::sync::atomic::AtomicBool::new(true)as a const fn — used to be unstable, became stable; many similar small stabilization stories live inRELEASES.md.xargo/cargo xbuild— the unofficial cross-build-stdtools. Replaced by the in-tree-Zbuild-stdflag, which is now the standard mechanism.
Major rewrites
| Rewrite | When | What |
|---|---|---|
| OCaml → self-hosted | 2010 | The whole compiler. |
Make → x.py |
early 1.x | The build system. |
bootstrap.py → src/bootstrap (Rust) |
mid-2010s | Bootstrap business logic moved out of Python and into Rust; bootstrap.py is now mostly a downloader. |
| Old AST → HIR (then THIR, then MIR) | 2015–2018 | The IR layering currently in rustc_hir, rustc_middle::thir, rustc_middle::mir. |
| Lexical → Non-Lexical Lifetimes | 2017–2018 | Borrow checker. |
| Old trait solver → new trait solver | 2022– | Ongoing. See rustc_next_trait_solver. |
| In-tree LLVM updates | continuous | The LLVM submodule at src/llvm-project/ is bumped every few months. |
Growth trajectory
A rough sketch derived from git history and RELEASES.md:
- Pre-1.0 (2010–2015) — small core team (single digits → low double digits). Rapid language churn.
- 1.0–1.20 era (2015–2017) — Mozilla-funded, ~50–100 active monthly contributors. Editions concept developed.
- 2018 edition era (2018–2021) — contributor count grows past several hundred per year. Subtree tools (clippy, miri, rustfmt, rustdoc) are folded into the development workflow.
- Foundation era (2021–present) — sustained ~thousand+ unique contributors per release. Multiple alternative codegen backends, two parallel trait solvers, and the ongoing migration to a 2024 edition default.
For the canonical, exact list of changes in each release, see RELEASES.md — it is the closest thing this project has to a singular changelog.
Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.