1. Getting Started
  2. About this guide
  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. 2.6. Suggest tests tool
  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. Contribution Procedures
  11. 7. About the compiler team
  12. 8. Using Git
  13. 9. Mastering @rustbot
  14. 10. Walkthrough: a typical contribution
  15. 11. Procedures for Breaking Changes
  16. 12. Implementing new features
  17. 13. Stability attributes
  18. 14. Stabilizing Features
  19. 15. Feature Gates
  20. 16. Coding conventions
  21. 17. Using external repositories
  22. 18. Fuzzing
  23. 19. Notification groups
    ❱
    1. 19.1. ARM
    2. 19.2. Cleanup Crew
    3. 19.3. LLVM
    4. 19.4. RISC-V
    5. 19.5. Windows
  24. 20. Licenses
  25. High-level Compiler Architecture
  26. 21. Prologue
  27. 22. Overview of the compiler
  28. 23. The compiler source code
  29. 24. Bootstrapping
  30. 25. Queries: demand-driven compilation
    ❱
    1. 25.1. The Query Evaluation Model in Detail
    2. 25.2. Incremental compilation
    3. 25.3. Incremental compilation In Detail
    4. 25.4. Debugging and Testing
    5. 25.5. Salsa
  31. 26. Memory Management in Rustc
  32. 27. Serialization in Rustc
  33. 28. Parallel Compilation
  34. 29. Rustdoc internals
  35. Source Code Representation
  36. 30. Prologue
  37. 31. Command-line arguments
  38. 32. rustc_driver and rustc_interface
    ❱
    1. 32.1. Example: Type checking
    2. 32.2. Example: Getting diagnostics
  39. 33. Syntax and the AST
    ❱
    1. 33.1. Lexing and Parsing
    2. 33.2. Macro expansion
    3. 33.3. Name resolution
    4. 33.4. #[test] Implementation
    5. 33.5. Panic Implementation
    6. 33.6. AST Validation
    7. 33.7. Feature Gate Checking
    8. 33.8. Lang Items
  40. 34. The HIR (High-level IR)
    ❱
    1. 34.1. Lowering AST to HIR
    2. 34.2. Debugging
  41. 35. The THIR (Typed High-level IR)
  42. 36. The MIR (Mid-level IR)
    ❱
    1. 36.1. MIR construction
    2. 36.2. MIR visitor and traversal
    3. 36.3. MIR passes: getting the MIR for a function
  43. 37. Identifiers in the compiler
  44. 38. Closure expansion
  45. 39. Inline assembly
  46. Analysis
  47. 40. Prologue
  48. 41. The ty module: representing types
    ❱
    1. 41.1. Generics and substitutions
    2. 41.2. TypeFolder and TypeFoldable
    3. 41.3. Generic arguments
    4. 41.4. Constants in the type system
  49. 42. Type inference
  50. 43. Trait solving
    ❱
    1. 43.1. Early and Late Bound Parameters
    2. 43.2. Higher-ranked trait bounds
    3. 43.3. Caching subtleties
    4. 43.4. Specialization
    5. 43.5. Chalk-based trait solving
      ❱
      1. 43.5.1. Lowering to logic
      2. 43.5.2. Goals and clauses
      3. 43.5.3. Canonical queries
    6. 43.6. Next-gen trait solving
      ❱
      1. 43.6.1. The solver
      2. 43.6.2. Canonicalization
      3. 43.6.3. Coinduction
  51. 44. Type checking
    ❱
    1. 44.1. Method Lookup
    2. 44.2. Variance
    3. 44.3. Opaque Types
      ❱
      1. 44.3.1. Inference details
  52. 45. Pattern and Exhaustiveness Checking
  53. 46. MIR dataflow
  54. 47. Drop elaboration
  55. 48. The borrow checker
    ❱
    1. 48.1. Tracking moves and initialization
      ❱
      1. 48.1.1. Move paths
    2. 48.2. MIR type checker
    3. 48.3. Region inference
      ❱
      1. 48.3.1. Constraint propagation
      2. 48.3.2. Lifetime parameters
      3. 48.3.3. Member constraints
      4. 48.3.4. Placeholders and universes
      5. 48.3.5. Closure constraints
      6. 48.3.6. Error reporting
    4. 48.4. Two-phase-borrows
  56. 49. Parameter Environments
  57. 50. Errors and Lints
    ❱
    1. 50.1. Diagnostic and subdiagnostic structs
    2. 50.2. Translation
    3. 50.3. LintStore
    4. 50.4. Error codes
    5. 50.5. Diagnostic items
    6. 50.6. ErrorGuaranteed
  58. MIR to Binaries
  59. 51. Prologue
  60. 52. MIR optimizations
  61. 53. Debugging
  62. 54. Constant evaluation
    ❱
    1. 54.1. Interpreter
  63. 55. Monomorphization
  64. 56. Lowering MIR
  65. 57. Code Generation
    ❱
    1. 57.1. Updating LLVM
    2. 57.2. Debugging LLVM
    3. 57.3. Backend Agnostic Codegen
    4. 57.4. Implicit Caller Location
  66. 58. Libraries and Metadata
  67. 59. Profile-guided Optimization
  68. 60. LLVM Source-Based Code Coverage
  69. 61. Sanitizers Support
  70. 62. Debugging support in the Rust compiler
  71. Appendix A: Background topics
  72. Appendix B: Glossary
  73. Appendix C: Code Index
  74. Appendix D: Compiler Lecture Series
  75. Appendix E: Bibliography
  76. Appendix Z: HumorRust

Rust Compiler Development Guide

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