1. About this guide
  2. Getting Started
  3. Building and debugging rustc
  4. 1. How to Build and Run the Compiler
    ❱
    1. 1.1. Prerequisites
    2. 1.2. Suggested Workflows
    3. 1.3. Distribution artifacts
    4. 1.4. Building Documentation
    5. 1.5. Rustdoc overview
    6. 1.6. Adding a new target
  5. 2. Testing the compiler
    ❱
    1. 2.1. Running tests
      ❱
      1. 2.1.1. Testing with Docker
      2. 2.1.2. Testing with CI
    2. 2.2. Adding new tests
    3. 2.3. Compiletest
      ❱
      1. 2.3.1. UI tests
      2. 2.3.2. Test headers
    4. 2.4. Performance testing
    5. 2.5. Crater
  6. 3. Debugging the Compiler
    ❱
    1. 3.1. Using the tracing/logging instrumentation
  7. 4. Profiling the compiler
    ❱
    1. 4.1. with the linux perf tool
    2. 4.2. with Windows Performance Analyzer
  8. 5. crates.io Dependencies
  9. Contributing to Rust
  10. 6. Introduction
  11. 7. About the compiler team
  12. 8. Using Git
  13. 9. Mastering @rustbot
  14. 10. Walkthrough: a typical contribution
  15. 11. Bug Fix Procedure
  16. 12. Implementing new features
  17. 13. Stability attributes
  18. 14. Stabilizing Features
  19. 15. Feature Gates
  20. 16. Coding conventions
  21. 17. Notification groups
    ❱
    1. 17.1. ARM
    2. 17.2. Cleanup Crew
    3. 17.3. LLVM
    4. 17.4. RISC-V
    5. 17.5. Windows
  22. 18. Licenses
  23. High-level Compiler Architecture
  24. 19. Prologue
  25. 20. Overview of the Compiler
  26. 21. The compiler source code
  27. 22. Bootstrapping
  28. 23. Queries: demand-driven compilation
    ❱
    1. 23.1. The Query Evaluation Model in Detail
    2. 23.2. Incremental compilation
    3. 23.3. Incremental compilation In Detail
    4. 23.4. Debugging and Testing
    5. 23.5. Salsa
  29. 24. Memory Management in Rustc
  30. 25. Serialization in Rustc
  31. 26. Parallel Compilation
  32. 27. Rustdoc internals
  33. Source Code Representation
  34. 28. Prologue
  35. 29. Command-line arguments
  36. 30. The Rustc Driver and Interface
    ❱
    1. 30.1. Example: Type checking
    2. 30.2. Example: Getting diagnostics
  37. 31. Syntax and the AST
    ❱
    1. 31.1. Lexing and Parsing
    2. 31.2. Macro expansion
    3. 31.3. Name resolution
    4. 31.4. #[test] Implementation
    5. 31.5. Panic Implementation
    6. 31.6. AST Validation
    7. 31.7. Feature Gate Checking
    8. 31.8. Lang Items
  38. 32. The HIR (High-level IR)
    ❱
    1. 32.1. Lowering AST to HIR
    2. 32.2. Debugging
  39. 33. The THIR (Typed High-level IR)
  40. 34. The MIR (Mid-level IR)
    ❱
    1. 34.1. MIR construction
    2. 34.2. MIR visitor and traversal
    3. 34.3. MIR passes: getting the MIR for a function
  41. 35. Identifiers in the Compiler
  42. 36. Closure expansion
  43. 37. Inline assembly
  44. Analysis
  45. 38. Prologue
  46. 39. The ty module: representing types
    ❱
    1. 39.1. Generics and substitutions
    2. 39.2. TypeFolder and TypeFoldable
    3. 39.3. Generic arguments
    4. 39.4. Constants in the type system
  47. 40. Type inference
  48. 41. Trait solving
    ❱
    1. 41.1. Early and Late Bound Parameters
    2. 41.2. Higher-ranked trait bounds
    3. 41.3. Caching subtleties
    4. 41.4. Specialization
    5. 41.5. Chalk-based trait solving
      ❱
      1. 41.5.1. Lowering to logic
      2. 41.5.2. Goals and clauses
      3. 41.5.3. Canonical queries
    6. 41.6. Next-gen trait solving
      ❱
      1. 41.6.1. The solver
      2. 41.6.2. Canonicalization
      3. 41.6.3. Coinduction
  49. 42. Type checking
    ❱
    1. 42.1. Method Lookup
    2. 42.2. Variance
    3. 42.3. Opaque Types
      ❱
      1. 42.3.1. Inference details
  50. 43. Pattern and Exhaustiveness Checking
  51. 44. MIR dataflow
  52. 45. Drop elaboration
  53. 46. The borrow checker
    ❱
    1. 46.1. Tracking moves and initialization
      ❱
      1. 46.1.1. Move paths
    2. 46.2. MIR type checker
    3. 46.3. Region inference
      ❱
      1. 46.3.1. Constraint propagation
      2. 46.3.2. Lifetime parameters
      3. 46.3.3. Member constraints
      4. 46.3.4. Placeholders and universes
      5. 46.3.5. Closure constraints
      6. 46.3.6. Error reporting
    4. 46.4. Two-phase-borrows
  54. 47. Parameter Environments
  55. 48. Errors and Lints
    ❱
    1. 48.1. Diagnostic and subdiagnostic structs
    2. 48.2. Translation
    3. 48.3. LintStore
    4. 48.4. Diagnostic codes
    5. 48.5. Diagnostic items
    6. 48.6. ErrorGuaranteed
  56. MIR to Binaries
  57. 49. Prologue
  58. 50. MIR optimizations
  59. 51. Debugging
  60. 52. Constant evaluation
    ❱
    1. 52.1. Interpreter
  61. 53. Monomorphization
  62. 54. Lowering MIR
  63. 55. Code Generation
    ❱
    1. 55.1. Updating LLVM
    2. 55.2. Debugging LLVM
    3. 55.3. Backend Agnostic Codegen
    4. 55.4. Implicit Caller Location
  64. 56. Libraries and Metadata
  65. 57. Profile-guided Optimization
  66. 58. LLVM Source-Based Code Coverage
  67. 59. Sanitizers Support
  68. 60. Debugging Support in the Rust Compiler
  69. Appendix A: Background topics
  70. Appendix B: Glossary
  71. Appendix C: Code Index
  72. Appendix D: Compiler Lecture Series
  73. Appendix E: Bibliography
  74. Appendix Z: HumorRust

Guide to Rustc Development

Humor in Rust

What's a project without a sense of humor? And frankly some of these are enlightening?

  • Weird exprs test
  • Ferris Rap
  • The Genesis of Generic Germination
  • The Bastion of the Turbofish test
  • Rust Koans
  • break rust;
  • The Nomicon Intro
  • rustc-ty renaming punfest
  • try using their name "ferris" instead
  • Forbid pineapple on pizza