Getting Started
About this guide
Building and debugging rustc
1.
How to build and run the compiler
❱
1.1.
Quickstart
1.2.
Prerequisites
1.3.
Suggested workflows
1.4.
Distribution artifacts
1.5.
Building documentation
1.6.
Rustdoc overview
1.7.
Adding a new target
1.8.
Optimized build
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.
Best practices
2.4.
Compiletest
❱
2.4.1.
UI tests
2.4.2.
Test directives
2.4.3.
Minicore
2.5.
Ecosystem testing
❱
2.5.1.
Crater
2.5.2.
Fuchsia
2.5.3.
Rust for Linux
2.6.
Codegen backend testing
❱
2.6.1.
Cranelift codegen backend
2.6.2.
GCC codegen backend
2.7.
Performance testing
2.8.
Suggest tests tool
2.9.
Misc info
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
4.3.
with the Rust benchmark suite
5.
crates.io dependencies
Contributing to Rust
6.
Contribution procedures
7.
About the compiler team
8.
Using Git
9.
Mastering @rustbot
10.
Walkthrough: a typical contribution
11.
Implementing new language features
12.
Stability attributes
13.
Stabilizing Features
14.
Feature Gates
15.
Coding conventions
16.
Procedures for breaking changes
17.
Using external repositories
18.
Fuzzing
19.
Notification groups
❱
19.1.
Apple
19.2.
ARM
19.3.
Cleanup Crew
19.4.
Emscripten
19.5.
Fuchsia
19.6.
LLVM
19.7.
RISC-V
19.8.
Rust for Linux
19.9.
WASI
19.10.
WebAssembly
19.11.
Windows
20.
Licenses
21.
Editions
Bootstrapping
22.
Prologue
23.
What Bootstrapping does
24.
How Bootstrap does it
25.
Writing tools in Bootstrap
26.
Debugging bootstrap
27.
cfg(bootstrap) in dependencies
High-level Compiler Architecture
28.
Prologue
29.
Overview of the compiler
30.
The compiler source code
31.
Queries: demand-driven compilation
❱
31.1.
The Query Evaluation Model in detail
31.2.
Incremental compilation
31.3.
Incremental compilation in detail
31.4.
Debugging and testing
31.5.
Salsa
32.
Memory management in rustc
33.
Serialization in rustc
34.
Parallel compilation
35.
Rustdoc internals
❱
35.1.
Search
35.2.
The rustdoc test suite
36.
Autodiff internals
❱
36.1.
Installation
36.2.
How to debug
36.3.
Autodiff flags
36.4.
Current limitations
Source Code Representation
37.
Prologue
38.
Syntax and the AST
❱
38.1.
Lexing and parsing
38.2.
Macro expansion
38.3.
Name resolution
38.4.
Attributes
38.5.
#[test] implementation
38.6.
Panic implementation
38.7.
AST validation
38.8.
Feature gate checking
38.9.
Lang Items
39.
The HIR (High-level IR)
❱
39.1.
Lowering AST to HIR
39.2.
Debugging
40.
The THIR (Typed High-level IR)
41.
The MIR (Mid-level IR)
❱
41.1.
MIR construction
41.2.
MIR visitor and traversal
41.3.
MIR queries and passes: getting the MIR
42.
Inline assembly
Supporting Infrastructure
43.
Command-line arguments
44.
rustc_driver and rustc_interface
❱
44.1.
Example: Type checking
44.2.
Example: Getting diagnostics
44.3.
Remarks on perma-unstable features
45.
Errors and lints
❱
45.1.
Diagnostic and subdiagnostic structs
45.2.
Translation
45.3.
LintStore
45.4.
Error codes
45.5.
Diagnostic items
45.6.
ErrorGuaranteed
Analysis
46.
Prologue
47.
Generic parameter definitions
❱
47.1.
EarlyBinder and instantiating parameters
48.
Binders and Higher ranked regions
❱
48.1.
Instantiating binders
49.
Early vs Late bound parameters
50.
The ty module: representing types
❱
50.1.
ADTs and Generic Arguments
50.2.
Parameter types/consts/regions
51.
TypeFolder and TypeFoldable
52.
Typing/Param Envs
53.
Type inference
54.
Trait solving
❱
54.1.
Higher-ranked trait bounds
54.2.
Caching subtleties
54.3.
Implied bounds
54.4.
Specialization
54.5.
Chalk-based trait solving
❱
54.5.1.
Lowering to logic
54.5.2.
Goals and clauses
54.5.3.
Canonical queries
54.5.4.
Canonicalization
54.6.
Next-gen trait solving
❱
54.6.1.
Invariants of the type system
54.6.2.
The solver
54.6.3.
Canonicalization
54.6.4.
Coinduction
54.6.5.
Caching
54.6.6.
Proof trees
54.6.7.
Normalization
54.6.8.
Opaque types
54.6.9.
Significant changes and quirks
54.7.
Unsize and CoerceUnsized traits
55.
Type checking
❱
55.1.
Method Lookup
55.2.
Variance
55.3.
Coherence checking
55.4.
Opaque types
❱
55.4.1.
Inference details
55.4.2.
Return Position Impl Trait In Trait
55.4.3.
Region inference restrictions
56.
Const condition checking
57.
Pattern and Exhaustiveness Checking
58.
Unsafety checking
59.
MIR dataflow
60.
Drop elaboration
61.
The borrow checker
❱
61.1.
Tracking moves and initialization
❱
61.1.1.
Move paths
61.2.
MIR type checker
61.3.
Drop check
61.4.
Region inference
❱
61.4.1.
Constraint propagation
61.4.2.
Lifetime parameters
61.4.3.
Member constraints
61.4.4.
Placeholders and universes
61.4.5.
Closure constraints
61.4.6.
Error reporting
61.5.
Two-phase-borrows
62.
Closure capture inference
63.
Async closures/"coroutine-closures"
MIR to Binaries
64.
Prologue
65.
MIR optimizations
66.
Debugging MIR
67.
Constant evaluation
❱
67.1.
Interpreter
68.
Monomorphization
69.
Lowering MIR
70.
Code Generation
❱
70.1.
Updating LLVM
70.2.
Debugging LLVM
70.3.
Backend Agnostic Codegen
70.4.
Implicit Caller Location
71.
Libraries and Metadata
72.
Profile-guided Optimization
73.
LLVM Source-Based Code Coverage
74.
Sanitizers Support
75.
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
Cranelift codegen backend tests
TODO: please add some more information to this page.