Skip to content

Commit 975626c

Browse files
eopbcompiler-errors
authored andcommitted
recommend unpretty=hir alongside unpretty=hir-tree
Previously at no point in the guide did we recommend `unpretty=hir`, only `unpretty=hir-tree`. I'm not sure if `unpretty=hir-tree` existed when this chapter was written. related: rust-lang/rustc-dev-guide#1159 I noticed that there's some duplicate information between here and the parent chapter https://rustc-dev-guide.rust-lang.org/hir.html I may try to merge https://rustc-dev-guide.rust-lang.org/hir-debugging.html into its parent in another PR.
1 parent 39fcd94 commit 975626c

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

Diff for: src/doc/rustc-dev-guide/src/hir-debugging.md

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
# HIR Debugging
22

3-
The `-Z unpretty=hir-tree` flag will dump out the HIR.
3+
Use the `-Z unpretty=hir` flag to produce a human-readable representation of the HIR.
4+
For cargo projects this can be done with `cargo rustc -- -Z unpretty=hir`.
5+
This output is useful when you need to see at a glance how your code was desugared and transformed
6+
during AST lowering.
7+
8+
For a full `Debug` dump of the data in the HIR, use the `-Z unpretty=hir-tree` flag.
9+
This may be useful when you need to see the full structure of the HIR from the perspective of the
10+
compiler.
411

512
If you are trying to correlate `NodeId`s or `DefId`s with source code, the
613
`-Z unpretty=expanded,identified` flag may be useful.

0 commit comments

Comments
 (0)