Skip to content

Commit bc5c1db

Browse files
committed
Edit Hir lowering
1 parent 7d697a9 commit bc5c1db

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/overview.md

+16
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,22 @@ The parser uses the standard `DiagnosticBuilder` API for error handling, but we
169169
try to recover, parsing a superset of Rust's grammar, while also emitting an error.
170170
`rustc_ast::ast::{Crate, Mod, Expr, Pat, ...}` AST nodes are returned from the parser.
171171

172+
### HIR lowering
173+
174+
We next take the AST and convert it to [High-Level Intermediate
175+
Representation (HIR)][hir], a more compiler-friendly representation of the
176+
AST. This process called "lowering". It involves a lot of desugaring of things
177+
like loops and `async fn`.
178+
179+
We then use the HIR to do [*type inference*] (the process of automatic
180+
detection of the type of an expression), [*trait solving*] (the process
181+
of pairing up an impl with each reference to a trait), and [*type
182+
checking*]. Type checking is the process of converting the types found in the HIR
183+
([`hir::Ty`]), which represent what the user wrote,
184+
into the internal representation used by the compiler ([`Ty<'tcx>`]).
185+
That information is usedto verify the type safety, correctness and
186+
coherence of the types used in the program.
187+
172188

173189
[String interning]: https://en.wikipedia.org/wiki/String_interning
174190
[`rustc_lexer`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_lexer/index.html

0 commit comments

Comments
 (0)