- 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. Ambig/Unambig Types and Consts
- 41.3. Debugging
- 42. The THIR (Typed High-level IR)
- 43. The MIR (Mid-level IR)
❱
- 43.1. MIR construction
- 43.2. MIR visitor and traversal
- 43.3. MIR queries and passes: getting the MIR
- 44. Inline assembly
- Supporting Infrastructure
- 45. Command-line arguments
- 46. rustc_driver and rustc_interface
❱
- 46.1. Remarks on perma-unstable features
- 46.2. Example: Type checking
- 46.3. Example: Getting diagnostics
- 47. Errors and lints
❱
- 47.1. Diagnostic and subdiagnostic structs
- 47.2. Translation
- 47.3. LintStore
- 47.4. Error codes
- 47.5. Diagnostic items
- 47.6. ErrorGuaranteed
- Analysis
- 48. Prologue
- 49. Generic parameter definitions
❱
- 49.1. EarlyBinder and instantiating parameters
- 50. Binders and Higher ranked regions
❱
- 50.1. Instantiating binders
- 51. Early vs Late bound parameters
- 52. The ty module: representing types
❱
- 52.1. ADTs and Generic Arguments
- 52.2. Parameter types/consts/regions
- 53. TypeFolder and TypeFoldable
- 54. Aliases and Normalization
- 55. Typing/Param Envs
- 56. Type inference
- 57. Trait solving
❱
- 57.1. Higher-ranked trait bounds
- 57.2. Caching subtleties
- 57.3. Implied bounds
- 57.4. Specialization
- 57.5. Chalk-based trait solving
❱
- 57.5.1. Lowering to logic
- 57.5.2. Goals and clauses
- 57.5.3. Canonical queries
- 57.5.4. Canonicalization
- 57.6. Next-gen trait solving
❱
- 57.6.1. Invariants of the type system
- 57.6.2. The solver
- 57.6.3. Candidate preference
- 57.6.4. Canonicalization
- 57.6.5. Coinduction
- 57.6.6. Caching
- 57.6.7. Proof trees
- 57.6.8. Opaque types
- 57.6.9. Significant changes and quirks
- 57.7. Unsize and CoerceUnsized traits
- 58. Variance
- 59. Coherence checking
- 60. HIR Type checking
❱
- 60.1. Coercions
- 60.2. Method lookup
- 61. Opaque types
❱
- 61.1. Inference details
- 61.2. Return Position Impl Trait In Trait
- 61.3. Region inference restrictions
- 62. Const condition checking
- 63. Pattern and exhaustiveness checking
- 64. Unsafety checking
- 65. MIR dataflow
- 66. Drop elaboration
- 67. The borrow checker
❱
- 67.1. Tracking moves and initialization
❱
- 67.1.1. Move paths
- 67.2. MIR type checker
- 67.3. Drop check
- 67.4. Region inference
❱
- 67.4.1. Constraint propagation
- 67.4.2. Lifetime parameters
- 67.4.3. Member constraints
- 67.4.4. Placeholders and universes
- 67.4.5. Closure constraints
- 67.4.6. Error reporting
- 67.5. Two-phase-borrows
- 68. Closure capture inference
- 69. Async closures/"coroutine-closures"
- MIR to binaries
- 70. Prologue
- 71. MIR optimizations
- 72. Debugging MIR
- 73. Constant evaluation
❱
- 73.1. Interpreter
- 74. Monomorphization
- 75. Lowering MIR
- 76. Code generation
❱
- 76.1. Updating LLVM
- 76.2. Debugging LLVM
- 76.3. Backend Agnostic Codegen
- 76.4. Implicit caller location
- 77. Libraries and metadata
- 78. Profile-guided optimization
- 79. LLVM source-based code coverage
- 80. Sanitizers support
- 81. 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