@@ -68,10 +68,12 @@ we'll talk about that later.
68
68
- We then take the AST and [ convert it to High-Level Intermediate
69
69
Representation (HIR)] [ hir ] . This is a compiler-friendly representation of the
70
70
AST. This involves a lot of desugaring of things like loops and ` async fn ` .
71
- - We use the HIR to do [ type inference] . This is the process of automatic
72
- detection of the type of an expression.
73
- - ** TODO: Maybe some other things are done here? I think initial type checking
74
- happens here? And trait solving?**
71
+ - We use the HIR to do [ type inference] (the process of automatic
72
+ detection of the type of an expression), [ trait solving] (the process
73
+ of pairing up an impl with each reference to a trait) and [ type
74
+ checking] (the process of converting the types found in the HIR
75
+ (hir::Ty), which represent the syntactic things that the user wrote,
76
+ into the internal representation used by the compiler (Ty<'tcx>)).
75
77
- The HIR is then [ lowered to Mid-Level Intermediate Representation (MIR)] [ mir ] .
76
78
- Along the way, we construct the THIR, which is an even more desugared HIR.
77
79
THIR is used for pattern and exhaustiveness checking. It is also more
@@ -111,6 +113,8 @@ we'll talk about that later.
111
113
[ parser ] : https://doc.rust-lang.org/nightly/nightly-rustc/rustc_parse/index.html
112
114
[ hir ] : https://doc.rust-lang.org/nightly/nightly-rustc/rustc_hir/index.html
113
115
[ type inference ] : https://rustc-dev-guide.rust-lang.org/type-inference.html
116
+ [ trait solving ] : https://rustc-dev-guide.rust-lang.org/traits/resolution.html
117
+ [ type checking ] : https://rustc-dev-guide.rust-lang.org/type-checking.html
114
118
[ mir ] : https://rustc-dev-guide.rust-lang.org/mir/index.html
115
119
[ borrow checking ] : https://rustc-dev-guide.rust-lang.org/borrow_check.html
116
120
[ mir-opt ] : https://rustc-dev-guide.rust-lang.org/mir/optimizations.html
0 commit comments