- 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 (stub)
- 2.6.2. GCC codegen backend
- 2.7. Performance testing
- 2.8. Autodiff CI job
- 2.9. Pre-stabilization CI job for the next solver and polonius alpha
- 2.10. Parallel frontend CI job
- 2.11. Standard library semver breakage test
- 2.12. 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. Writing rustc-dev-guide documentation
- 8. About the compiler team
- 9. Using Git
- 10. Mastering @rustbot
- 11. Running LLMs
❱
- 11.1. Writing code with LLMs
- 11.2. Reviewing code with LLMs
- 12. Walkthrough: a typical contribution
- 13. Implementing new language features
- 14. Stability guarantees
- 15. Stability attributes
- 16. Stabilizing language features
❱
- 16.1. Stabilization report template
- 17. Feature Gates
- 18. Coding conventions
- 19. Procedures for breaking changes
- 20. Using external repositories
- 21. Fuzzing
- 22. Notification groups
❱
- 22.1. Apple
- 22.2. ARM
- 22.3. Emscripten
- 22.4. Fuchsia
- 22.5. LoongArch
- 22.6. RISC-V
- 22.7. Rust for Linux
- 22.8. WASI
- 22.9. WebAssembly
- 22.10. Windows
- 22.11. GPU target
- 23. Licenses
- 24. Editions
- Bootstrapping
- 25. Prologue
- 26. What Bootstrapping does
- 27. How Bootstrap does it
- 28. Writing tools in Bootstrap
- 29. Debugging bootstrap
- 30. cfg(bootstrap) in dependencies
- High-level compiler architecture
- 31. Prologue
- 32. Overview of the compiler
- 33. The compiler source code
- 34. Queries: demand-driven compilation
❱
- 34.1. The Query Evaluation Model in detail
- 34.2. Incremental compilation
- 34.3. Incremental compilation in detail
- 34.4. Debugging and testing
- 34.5. Salsa
- 35. Memory management in rustc
- 36. Serialization in rustc
- 37. Parallel compilation
- 38. Rustdoc internals
❱
- 38.1. Search
- 38.2. The rustdoc-html test suite
- 38.3. The rustdoc-gui test suite (stub)
- 38.4. The rustdoc-json test suite
- 39. GPU offload internals
❱
- 39.1. Installation
- 39.2. Usage
- 39.3. Contributing
- 40. Autodiff internals
❱
- 40.1. Installation
- 40.2. How to debug
- 40.3. Autodiff flags
- 40.4. Type Trees
- Source code representation
- 41. Prologue
- 42. Syntax and the AST
❱
- 42.1. Lexing and parsing
- 42.2. Macro expansion
- 42.3. Name resolution
- 42.4. Attributes
- 42.5. #[test] implementation
- 42.6. Panic implementation
- 42.7. AST validation
- 42.8. Feature gate checking
- 42.9. Lang Items
- 43. The HIR (High-level IR)
❱
- 43.1. Lowering AST to HIR
- 43.2. Attribute Parsing
- 43.3. Debugging
- 44. Ambig/Unambig Types and Consts
- 45. The THIR (Typed High-level IR)
- 46. The MIR (Mid-level IR)
❱
- 46.1. MIR construction
- 46.2. MIR visitor and traversal
- 46.3. MIR queries and passes: getting the MIR
- 47. Inline assembly
- Supporting infrastructure
- 48. Command-line arguments
- 49. rustc_driver and rustc_interface
❱
- 49.1. External rustc_drivers
- 49.2. Example: Type checking
- 49.3. Example: Getting diagnostics
- 50. Errors and lints
❱
- 50.1. Diagnostic and subdiagnostic structs
- 50.2. Translation
- 50.3. LintStore
- 50.4. Error codes
- 50.5. Diagnostic items
- 50.6. ErrorGuaranteed
- Analysis
- 51. Prologue
- 52. Generic parameter definitions
❱
- 52.1. EarlyBinder and instantiating parameters
- 53. Binders and Higher ranked regions
❱
- 53.1. Instantiating binders
- 54. Early vs Late bound parameters
- 55. The ty module: representing types
❱
- 55.1. ADTs and Generic Arguments
- 55.2. Parameter types/consts/regions
- 56. TypeFolder and TypeFoldable
- 57. Aliases and normalization
- 58. Typing/Param envs
- 59. Type inference
- 60. Trait solving
❱
- 60.1. Higher-ranked trait bounds
- 60.2. Caching subtleties
- 60.3. Implied bounds
- 60.4. Specialization
- 60.5. Chalk-based trait solving
❱
- 60.5.1. Lowering to logic
- 60.5.2. Goals and clauses
- 60.5.3. Canonical queries
- 60.5.4. Canonicalization
- 60.6. Next-gen trait solving
❱
- 60.6.1. Invariants of the type system
- 60.6.2. The solver
- 60.6.3. Candidate preference
- 60.6.4. Canonicalization
- 60.6.5. Coinduction
- 60.6.6. Caching
- 60.6.7. Proof trees
- 60.6.8. Opaque types
- 60.6.9. Significant changes and quirks
- 60.6.10. Sharing the trait solver with rust-analyzer
- 60.7. Unsize and CoerceUnsized traits
- 60.8. Having separate Trait and Projection bounds
- 61. Well-formedness
- 62. Variance
- 63. Coherence checking
- 64. HIR Type checking
❱
- 64.1. Coercions
- 64.2. Method lookup
- 65. Const generics
- 66. Opaque types
❱
- 66.1. Inference details
- 66.2. Return Position Impl Trait In Trait
- 66.3. Region inference restrictions
- 67. Const traits and const condition checking
- 68. Pattern and exhaustiveness checking
- 69. Unsafety checking
- 70. MIR dataflow
- 71. Drop elaboration
- 72. The borrow checker
❱
- 72.1. Tracking moves and initialization
❱
- 72.1.1. Move paths
- 72.2. MIR type checker
- 72.3. Drop check
- 72.4. Region inference
❱
- 72.4.1. Constraint propagation
- 72.4.2. Lifetime parameters
- 72.4.3. Member constraints
- 72.4.4. Placeholders and universes
- 72.4.5. Closure constraints
- 72.4.6. Error reporting (stub)
- 72.5. Two-phase-borrows
- 72.6. Debugging the borrow checker
- 73. Closure capture inference
- 74. Async closures/"coroutine-closures"
- MIR to binaries
- 75. Prologue
- 76. MIR optimizations
- 77. Debugging MIR
- 78. Constant evaluation
❱
- 78.1. Interpreter
- 79. Monomorphization
- 80. Lowering MIR
- 81. Code generation
❱
- 81.1. Updating LLVM
- 81.2. Debugging LLVM
- 81.3. Backend Agnostic Codegen
- 81.4. Implicit caller location
- 82. Debug info
❱
- 82.1. Rust codegen
- 82.2. LLVM codegen
- 82.3. Debugger internals
❱
- 82.3.1. LLDB internals
- 82.3.2. GDB internals (stub)
- 82.4. Debugger visualizers
❱
- 82.4.1. LLDB - Python Providers
- 82.4.2. GDB - Python Providers
- 82.4.3. CDB - Natvis (stub)
- 82.5. Testing (stub)
- 82.6. (Lecture notes) Debugging support in the Rust compiler
- 83. Libraries and metadata
- 84. Profile-guided optimization
- 85. LLVM source-based code coverage
- 86. Sanitizers support
- Appendix A: Background topics
- Appendix B: Glossary
- Appendix C: Code Index
- Appendix D: Compiler Lecture Series
- Appendix E: Bibliography
- Appendix F: Reading club sessions
- Appendix Z: HumorRust