From bfe8e98253d4f2c24d119b3812bf41f8513a0c3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Lanteri=20Thauvin?= Date: Tue, 9 Mar 2021 11:44:02 +0100 Subject: [PATCH] Update lins --- src/thir.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/thir.md b/src/thir.md index efbc5284..b023eb2e 100644 --- a/src/thir.md +++ b/src/thir.md @@ -33,10 +33,12 @@ But it has some other interesting features that distinguish it from the HIR: [HIR]: ./hir.md -The THIR lives in [`rustc_mir_build::thir`][thir]. To construct a `thir::Expr`, -you can use the `build_thir` function, passing in the memory arena where the THIR +The THIR lives in [`rustc_mir_build::thir`][thir-docs]. To construct a [`thir::Expr`], +you can use the [`build_thir`] function, passing in the memory arena where the THIR 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. -[thir]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_mir_build/thir/index.html +[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