From 6db7573c78265c8aac3f105a73bc9f00f98b7804 Mon Sep 17 00:00:00 2001 From: Smitty Date: Thu, 13 May 2021 14:17:21 -0400 Subject: [PATCH 1/2] document -Zunpretty=thir-tree --- src/thir.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/thir.md b/src/thir.md index b023eb2e2..3f65f5be5 100644 --- a/src/thir.md +++ b/src/thir.md @@ -9,6 +9,10 @@ The THIR ("Typed High-Level Intermediate Representation"), previously called HAI [it may also soon be used for unsafety checking][thir-unsafeck] as a replacement for the current MIR unsafety checker. + +You can get a human-readable repersentation of the THIR by passing the `-Zunpretty=thir-tree` flag +to `rustc`. + [type checking]: ./type-checking.md [MIR construction]: ./mir/construction.md [exhaustiveness checking]: ./pat-exhaustive-checking.md From c60aecef5e06c6c0a01885a75abb5fe97204f735 Mon Sep 17 00:00:00 2001 From: Smitty Date: Thu, 13 May 2021 14:42:11 -0400 Subject: [PATCH 2/2] Update position/wording --- src/thir.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/thir.md b/src/thir.md index 3f65f5be5..0a0218c6b 100644 --- a/src/thir.md +++ b/src/thir.md @@ -9,10 +9,6 @@ The THIR ("Typed High-Level Intermediate Representation"), previously called HAI [it may also soon be used for unsafety checking][thir-unsafeck] as a replacement for the current MIR unsafety checker. - -You can get a human-readable repersentation of the THIR by passing the `-Zunpretty=thir-tree` flag -to `rustc`. - [type checking]: ./type-checking.md [MIR construction]: ./mir/construction.md [exhaustiveness checking]: ./pat-exhaustive-checking.md @@ -43,6 +39,9 @@ will be allocated. Dropping this arena will result in the THIR being destroyed, which is useful to keep peak memory in check. Having a THIR representation of all bodies of a crate in memory at the same time would be very heavy. +You can get a debug representation of the THIR by passing the `-Zunpretty=thir-tree` flag +to `rustc`. + [thir-docs]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_mir_build/thir/index.html [`thir::Expr`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_mir_build/thir/struct.Expr.html [`build_thir`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_mir_build/thir/fn.build_thir.html