Skip to content

Commit a2d2cfa

Browse files
committed
Explain how to dump HIR
1 parent 96d3038 commit a2d2cfa

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/hir.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,14 @@ been desugared away (as an example, `for` loops are converted into a
1010

1111
This chapter covers the main concepts of the HIR.
1212

13+
You can view the HIR representation of your code by passing the
14+
`-Zunpretty=hir-tree` flag to rustc, for example by setting the `RUSTFLAGS`
15+
environment variable:
16+
17+
```
18+
RUSTFLAGS=-Zunpretty=hir-tree cargo build
19+
```
20+
1321
### Out-of-band storage and the `Crate` type
1422

1523
The top-level data-structure in the HIR is the `Crate`, which stores

0 commit comments

Comments
 (0)