- 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. Emscripten
- 19.4. Fuchsia
- 19.5. RISC-V
- 19.6. Rust for Linux
- 19.7. WASI
- 19.8. WebAssembly
- 19.9. 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
- 35.3. The rustdoc-gui test suite
- 35.4. The rustdoc-json test suite
- 36. GPU offload internals
❱
- 36.1. Installation
- 37. Autodiff internals
❱
- 37.1. Installation
- 37.2. How to debug
- 37.3. Autodiff flags
- 37.4. Current limitations
- Source Code Representation
- 38. Prologue
- 39. Syntax and the AST
❱
- 39.1. Lexing and parsing
- 39.2. Macro expansion
- 39.3. Name resolution
- 39.4. Attributes
- 39.5. #[test] implementation
- 39.6. Panic implementation
- 39.7. AST validation
- 39.8. Feature gate checking
- 39.9. Lang Items
- 40. The HIR (High-level IR)
❱
- 40.1. Lowering AST to HIR
- 40.2. Ambig/Unambig Types and Consts
- 40.3. Debugging
- 41. The THIR (Typed High-level IR)
- 42. The MIR (Mid-level IR)
❱
- 42.1. MIR construction
- 42.2. MIR visitor and traversal
- 42.3. MIR queries and passes: getting the MIR
- 43. Inline assembly
- Supporting Infrastructure
- 44. Command-line arguments
- 45. rustc_driver and rustc_interface
❱
- 45.1. Remarks on perma-unstable features
- 45.2. Example: Type checking
- 45.3. Example: Getting diagnostics
- 46. Errors and lints
❱
- 46.1. Diagnostic and subdiagnostic structs
- 46.2. Translation
- 46.3. LintStore
- 46.4. Error codes
- 46.5. Diagnostic items
- 46.6. ErrorGuaranteed
- Analysis
- 47. Prologue
- 48. Generic parameter definitions
❱
- 48.1. EarlyBinder and instantiating parameters
- 49. Binders and Higher ranked regions
❱
- 49.1. Instantiating binders
- 50. Early vs Late bound parameters
- 51. The ty module: representing types
❱
- 51.1. ADTs and Generic Arguments
- 51.2. Parameter types/consts/regions
- 52. TypeFolder and TypeFoldable
- 53. Aliases and Normalization
- 54. Typing/Param Envs
- 55. Type inference
- 56. Trait solving
❱
- 56.1. Higher-ranked trait bounds
- 56.2. Caching subtleties
- 56.3. Implied bounds
- 56.4. Specialization
- 56.5. Chalk-based trait solving
❱
- 56.5.1. Lowering to logic
- 56.5.2. Goals and clauses
- 56.5.3. Canonical queries
- 56.5.4. Canonicalization
- 56.6. Next-gen trait solving
❱
- 56.6.1. Invariants of the type system
- 56.6.2. The solver
- 56.6.3. Canonicalization
- 56.6.4. Coinduction
- 56.6.5. Caching
- 56.6.6. Proof trees
- 56.6.7. Opaque types
- 56.6.8. Significant changes and quirks
- 56.7. Unsize and CoerceUnsized traits
- 57. Type checking
❱
- 57.1. Method lookup
- 57.2. Variance
- 57.3. Coherence checking
- 57.4. Opaque types
❱
- 57.4.1. Inference details
- 57.4.2. Return Position Impl Trait In Trait
- 57.4.3. Region inference restrictions
- 58. Const condition checking
- 59. Pattern and exhaustiveness checking
- 60. Unsafety checking
- 61. MIR dataflow
- 62. Drop elaboration
- 63. The borrow checker
❱
- 63.1. Tracking moves and initialization
❱
- 63.1.1. Move paths
- 63.2. MIR type checker
- 63.3. Drop check
- 63.4. Region inference
❱
- 63.4.1. Constraint propagation
- 63.4.2. Lifetime parameters
- 63.4.3. Member constraints
- 63.4.4. Placeholders and universes
- 63.4.5. Closure constraints
- 63.4.6. Error reporting
- 63.5. Two-phase-borrows
- 64. Closure capture inference
- 65. Async closures/"coroutine-closures"
- MIR to binaries
- 66. Prologue
- 67. MIR optimizations
- 68. Debugging MIR
- 69. Constant evaluation
❱
- 69.1. Interpreter
- 70. Monomorphization
- 71. Lowering MIR
- 72. Code generation
❱
- 72.1. Updating LLVM
- 72.2. Debugging LLVM
- 72.3. Backend Agnostic Codegen
- 72.4. Implicit caller location
- 73. Libraries and metadata
- 74. Profile-guided optimization
- 75. LLVM source-based code coverage
- 76. Sanitizers support
- 77. 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