File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change 1
1
# The HIR
2
2
3
- The HIR – "High-level IR" – is the primary IR used in most of rustc.
4
- It is a desugared version of the "abstract syntax tree" (AST) that is generated
5
- after parsing, macro expansion, and name resolution have completed. Many parts
6
- of HIR resemble Rust surface syntax quite closely, with the exception that some
7
- of Rust's expression forms have been desugared away (as an example, ` for ` loops
8
- are converted into a ` loop ` and do not appear in the HIR).
3
+ The HIR – "High-level IR" – is the primary IR used in most of rustc. It is a
4
+ compiler-friendly representation of the abstract syntax tree (AST) that is
5
+ generated after parsing, macro expansion, and name resolution have completed.
6
+ Many parts of HIR resemble Rust surface syntax quite closely, with the
7
+ exception that some of Rust's expression forms have been desugared away. For
8
+ example, ` for ` loops are converted into a ` loop ` and do not appear in the HIR.
9
+ This makes HIR more amenable to analysis than a normal AST.
9
10
10
11
This chapter covers the main concepts of the HIR.
11
12
You can’t perform that action at this time.
0 commit comments