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.
Building Documentation
1.5.
Rustdoc overview
1.6.
Adding a new target
2.
Testing the compiler
❱
2.1.
Running tests
❱
2.1.1.
Testing with Docker
2.1.2.
Testing with CI
2.2.
Adding new tests
2.3.
Compiletest
❱
2.3.1.
UI tests
2.3.2.
Test headers
2.4.
Performance testing
2.5.
Crater
3.
Debugging the compiler
❱
3.1.
Using the tracing/logging instrumentation
4.
Profiling the compiler
❱
4.1.
with the linux perf tool
4.2.
with Windows Performance Analyzer
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.
Fuzzing
18.
Notification groups
❱
18.1.
ARM
18.2.
Cleanup Crew
18.3.
LLVM
18.4.
RISC-V
18.5.
Windows
19.
Licenses
High-level Compiler Architecture
20.
Prologue
21.
Overview of the compiler
22.
The compiler source code
23.
Bootstrapping
24.
Queries: demand-driven compilation
❱
24.1.
The Query Evaluation Model in Detail
24.2.
Incremental compilation
24.3.
Incremental compilation In Detail
24.4.
Debugging and Testing
24.5.
Salsa
25.
Memory Management in Rustc
26.
Serialization in Rustc
27.
Parallel Compilation
28.
Rustdoc internals
Source Code Representation
29.
Prologue
30.
Command-line arguments
31.
rustc_driver and rustc_interface
❱
31.1.
Example: Type checking
31.2.
Example: Getting diagnostics
32.
Syntax and the AST
❱
32.1.
Lexing and Parsing
32.2.
Macro expansion
32.3.
Name resolution
32.4.
#[test] Implementation
32.5.
Panic Implementation
32.6.
AST Validation
32.7.
Feature Gate Checking
32.8.
Lang Items
33.
The HIR (High-level IR)
❱
33.1.
Lowering AST to HIR
33.2.
Debugging
34.
The THIR (Typed High-level IR)
35.
The MIR (Mid-level IR)
❱
35.1.
MIR construction
35.2.
MIR visitor and traversal
35.3.
MIR passes: getting the MIR for a function
36.
Identifiers in the compiler
37.
Closure expansion
38.
Inline assembly
Analysis
39.
Prologue
40.
The ty module: representing types
❱
40.1.
Generics and substitutions
40.2.
TypeFolder and TypeFoldable
40.3.
Generic arguments
40.4.
Constants in the type system
41.
Type inference
42.
Trait solving
❱
42.1.
Early and Late Bound Parameters
42.2.
Higher-ranked trait bounds
42.3.
Caching subtleties
42.4.
Specialization
42.5.
Chalk-based trait solving
❱
42.5.1.
Lowering to logic
42.5.2.
Goals and clauses
42.5.3.
Canonical queries
42.6.
Next-gen trait solving
❱
42.6.1.
The solver
42.6.2.
Canonicalization
42.6.3.
Coinduction
43.
Type checking
❱
43.1.
Method Lookup
43.2.
Variance
43.3.
Opaque Types
❱
43.3.1.
Inference details
44.
Pattern and Exhaustiveness Checking
45.
MIR dataflow
46.
Drop elaboration
47.
The borrow checker
❱
47.1.
Tracking moves and initialization
❱
47.1.1.
Move paths
47.2.
MIR type checker
47.3.
Region inference
❱
47.3.1.
Constraint propagation
47.3.2.
Lifetime parameters
47.3.3.
Member constraints
47.3.4.
Placeholders and universes
47.3.5.
Closure constraints
47.3.6.
Error reporting
47.4.
Two-phase-borrows
48.
Parameter Environments
49.
Errors and Lints
❱
49.1.
Diagnostic and subdiagnostic structs
49.2.
Translation
49.3.
LintStore
49.4.
Error codes
49.5.
Diagnostic items
49.6.
ErrorGuaranteed
MIR to Binaries
50.
Prologue
51.
MIR optimizations
52.
Debugging
53.
Constant evaluation
❱
53.1.
Interpreter
54.
Monomorphization
55.
Lowering MIR
56.
Code Generation
❱
56.1.
Updating LLVM
56.2.
Debugging LLVM
56.3.
Backend Agnostic Codegen
56.4.
Implicit Caller Location
57.
Libraries and Metadata
58.
Profile-guided Optimization
59.
LLVM Source-Based Code Coverage
60.
Sanitizers Support
61.
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
Rust Compiler Development Guide
Feature Gate Checking
TODO
: this chapter
#1158