- 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. 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 guarantees
- 13. Stability attributes
- 14. Stabilizing language features
❱
- 14.1. Stabilization report template
- 15. Feature Gates
- 16. Coding conventions
- 17. Procedures for breaking changes
- 18. Using external repositories
- 19. Fuzzing
- 20. Notification groups
❱
- 20.1. Apple
- 20.2. ARM
- 20.3. Emscripten
- 20.4. Fuchsia
- 20.5. RISC-V
- 20.6. Rust for Linux
- 20.7. WASI
- 20.8. WebAssembly
- 20.9. Windows
- 21. Licenses
- 22. Editions
- Bootstrapping
- 23. Prologue
- 24. What Bootstrapping does
- 25. How Bootstrap does it
- 26. Writing tools in Bootstrap
- 27. Debugging bootstrap
- 28. cfg(bootstrap) in dependencies
- High-level Compiler Architecture
- 29. Prologue
- 30. Overview of the compiler
- 31. The compiler source code
- 32. Queries: demand-driven compilation
❱
- 32.1. The Query Evaluation Model in detail
- 32.2. Incremental compilation
- 32.3. Incremental compilation in detail
- 32.4. Debugging and testing
- 32.5. Salsa
- 33. Memory management in rustc
- 34. Serialization in rustc
- 35. Parallel compilation
- 36. Rustdoc internals
❱
- 36.1. Search
- 36.2. The rustdoc test suite
- 36.3. The rustdoc-gui test suite
- 36.4. The rustdoc-json test suite
- 37. GPU offload internals
❱
- 37.1. Installation
- 37.2. Usage
- 38. Autodiff internals
❱
- 38.1. Installation
- 38.2. How to debug
- 38.3. Autodiff flags
- 38.4. Type Trees
- Source Code Representation
- 39. Prologue
- 40. Syntax and the AST
❱
- 40.1. Lexing and parsing
- 40.2. Macro expansion
- 40.3. Name resolution
- 40.4. Attributes
- 40.5. #[test] implementation
- 40.6. Panic implementation
- 40.7. AST validation
- 40.8. Feature gate checking
- 40.9. Lang Items
- 41. The HIR (High-level IR)
❱
- 41.1. Lowering AST to HIR
- 41.2. Debugging
- 42. Ambig/Unambig Types and Consts
- 43. The THIR (Typed High-level IR)
- 44. The MIR (Mid-level IR)
❱
- 44.1. MIR construction
- 44.2. MIR visitor and traversal
- 44.3. MIR queries and passes: getting the MIR
- 45. Inline assembly
- Supporting Infrastructure
- 46. Command-line arguments
- 47. rustc_driver and rustc_interface
❱
- 47.1. Remarks on perma-unstable features
- 47.2. Example: Type checking
- 47.3. Example: Getting diagnostics
- 48. Errors and lints
❱
- 48.1. Diagnostic and subdiagnostic structs
- 48.2. Translation
- 48.3. LintStore
- 48.4. Error codes
- 48.5. Diagnostic items
- 48.6. ErrorGuaranteed
- Analysis
- 49. Prologue
- 50. Generic parameter definitions
❱
- 50.1. EarlyBinder and instantiating parameters
- 51. Binders and Higher ranked regions
❱
- 51.1. Instantiating binders
- 52. Early vs Late bound parameters
- 53. The ty module: representing types
❱
- 53.1. ADTs and Generic Arguments
- 53.2. Parameter types/consts/regions
- 54. TypeFolder and TypeFoldable
- 55. Aliases and Normalization
- 56. Typing/Param Envs
- 57. Type inference
- 58. Trait solving
❱
- 58.1. Higher-ranked trait bounds
- 58.2. Caching subtleties
- 58.3. Implied bounds
- 58.4. Specialization
- 58.5. Chalk-based trait solving
❱
- 58.5.1. Lowering to logic
- 58.5.2. Goals and clauses
- 58.5.3. Canonical queries
- 58.5.4. Canonicalization
- 58.6. Next-gen trait solving
❱
- 58.6.1. Invariants of the type system
- 58.6.2. The solver
- 58.6.3. Candidate preference
- 58.6.4. Canonicalization
- 58.6.5. Coinduction
- 58.6.6. Caching
- 58.6.7. Proof trees
- 58.6.8. Opaque types
- 58.6.9. Significant changes and quirks
- 58.6.10. Sharing the trait solver with rust-analyzer
- 58.7. Unsize and CoerceUnsized traits
- 59. Variance
- 60. Coherence checking
- 61. HIR Type checking
❱
- 61.1. Coercions
- 61.2. Method lookup
- 62. Const Generics
- 63. Opaque types
❱
- 63.1. Inference details
- 63.2. Return Position Impl Trait In Trait
- 63.3. Region inference restrictions
- 64. Const condition checking
- 65. Pattern and exhaustiveness checking
- 66. Unsafety checking
- 67. MIR dataflow
- 68. Drop elaboration
- 69. The borrow checker
❱
- 69.1. Tracking moves and initialization
❱
- 69.1.1. Move paths
- 69.2. MIR type checker
- 69.3. Drop check
- 69.4. Region inference
❱
- 69.4.1. Constraint propagation
- 69.4.2. Lifetime parameters
- 69.4.3. Member constraints
- 69.4.4. Placeholders and universes
- 69.4.5. Closure constraints
- 69.4.6. Error reporting
- 69.5. Two-phase-borrows
- 70. Closure capture inference
- 71. Async closures/"coroutine-closures"
- MIR to binaries
- 72. Prologue
- 73. MIR optimizations
- 74. Debugging MIR
- 75. Constant evaluation
❱
- 75.1. Interpreter
- 76. Monomorphization
- 77. Lowering MIR
- 78. Code generation
❱
- 78.1. Updating LLVM
- 78.2. Debugging LLVM
- 78.3. Backend Agnostic Codegen
- 78.4. Implicit caller location
- 79. Libraries and metadata
- 80. Profile-guided optimization
- 81. LLVM source-based code coverage
- 82. Sanitizers support
- 83. 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