About this guide
Getting Started
Building and debugging rustc
1.
How to Build and Run the Compiler
❱
1.1.
Prerequisites
1.2.
Suggested Workflows
1.3.
Distribution artifacts
1.4.
Documenting Compiler
1.5.
Rustdoc
1.6.
ctags
1.7.
Adding a new target
2.
The compiler testing framework
❱
2.1.
Running tests
2.2.
Adding new tests
2.3.
Using compiletest commands to control test execution
3.
Debugging the Compiler
4.
Profiling the compiler
❱
4.1.
with the linux perf tool
5.
crates.io Dependencies
Contributing to Rust
6.
Introduction
7.
About the compiler team
8.
Using Git
9.
Mastering @rustbot
10.
Walkthrough: a typical contribution
11.
Bug Fix Procedure
12.
Implementing new features
13.
Stability attributes
14.
Stabilizing Features
15.
Feature Gates
16.
Coding conventions
17.
Notification groups
❱
17.1.
ARM
17.2.
Cleanup Crew
17.3.
LLVM
17.4.
RISC-V
17.5.
Windows
18.
Licenses
High-level Compiler Architecture
19.
Prologue
20.
Overview of the Compiler
21.
The compiler source code
22.
Bootstrapping
23.
Queries: demand-driven compilation
❱
23.1.
The Query Evaluation Model in Detail
23.2.
Incremental compilation
23.3.
Incremental compilation In Detail
23.4.
Debugging and Testing
23.5.
Profiling Queries
23.6.
Salsa
24.
Memory Management in Rustc
25.
Serialization in Rustc
26.
Parallel Compilation
27.
Rustdoc
Source Code Representation
28.
Prologue
29.
Command-line arguments
30.
The Rustc Driver and Interface
❱
30.1.
Ex: Type checking through rustc_interface
30.2.
Ex: Getting diagnostics through rustc_interface
31.
Syntax and the AST
❱
31.1.
Lexing and Parsing
31.2.
Macro expansion
31.3.
Name resolution
31.4.
#[test] Implementation
31.5.
Panic Implementation
31.6.
AST Validation
31.7.
Feature Gate Checking
32.
The HIR (High-level IR)
❱
32.1.
Lowering AST to HIR
32.2.
Debugging
33.
The MIR (Mid-level IR)
❱
33.1.
THIR and MIR construction
33.2.
MIR visitor and traversal
33.3.
MIR passes: getting the MIR for a function
34.
Identifiers in the Compiler
35.
Closure expansion
Analysis
36.
Prologue
37.
The ty module: representing types
❱
37.1.
Generics and substitutions
37.2.
TypeFolder and TypeFoldable
37.3.
Generic arguments
38.
Type inference
39.
Trait solving
❱
39.1.
Early and Late Bound Parameters
39.2.
Higher-ranked trait bounds
39.3.
Caching subtleties
39.4.
Specialization
39.5.
Chalk-based trait solving
❱
39.5.1.
Lowering to logic
39.5.2.
Goals and clauses
39.5.3.
Canonical queries
40.
Type checking
❱
40.1.
Method Lookup
40.2.
Variance
40.3.
Opaque Types
41.
Pattern and Exhaustiveness Checking
42.
MIR dataflow
43.
The borrow checker
❱
43.1.
Tracking moves and initialization
❱
43.1.1.
Move paths
43.2.
MIR type checker
43.3.
Region inference
❱
43.3.1.
Constraint propagation
43.3.2.
Lifetime parameters
43.3.3.
Member constraints
43.3.4.
Placeholders and universes
43.3.5.
Closure constraints
43.3.6.
Error reporting
43.4.
Two-phase-borrows
44.
Parameter Environments
45.
Errors and Lints
❱
45.1.
Creating Errors With SessionDiagnostic
45.2.
LintStore
45.3.
Diagnostic Codes
MIR to Binaries
46.
Prologue
47.
MIR optimizations
48.
Debugging
49.
Constant evaluation
❱
49.1.
miri const evaluator
50.
Monomorphization
51.
Lowering MIR
52.
Code Generation
❱
52.1.
Updating LLVM
52.2.
Debugging LLVM
52.3.
Backend Agnostic Codegen
52.4.
Implicit Caller Location
53.
Profile-guided Optimization
54.
LLVM Source-Based Code Coverage
55.
Sanitizers Support
56.
Debugging Support in the Rust Compiler
Appendix A: Background topics
Appendix B: Glossary
Appendix C: Code Index
Appendix D: Compiler Lecture Series
Appendix E: Bibliography
Appendix Z: HumorRust
Light (default)
Rust
Coal
Navy
Ayu
Guide to Rustc Development
Feature Gate Checking
TODO
: this chapter