Skip to content

Commit 359e814

Browse files
committed
reword HIR intro. Fix rust-lang#116
1 parent c11f57a commit 359e814

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/hir.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
# The HIR
22

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.
910

1011
This chapter covers the main concepts of the HIR.
1112

0 commit comments

Comments
 (0)