about summary refs log tree commit diff
path: root/compiler/rustc_driver_impl
diff options
context:
space:
mode:
authorTrevor Gross <t.gross35@gmail.com>2025-06-20 02:50:40 -0400
committerGitHub <noreply@github.com>2025-06-20 02:50:40 -0400
commitdd41c06e27df4f1e80f236d4c4bd47606773468d (patch)
tree730ea605dca9b22eeaaf8fc5871ea2fa25e4f48d /compiler/rustc_driver_impl
parent52758b7329d436979f8bd8a36d1ca4c476a663fd (diff)
parentede48910fdb8956f4a23a3bb29ded754206a3ef2 (diff)
downloadrust-dd41c06e27df4f1e80f236d4c4bd47606773468d.tar.gz
rust-dd41c06e27df4f1e80f236d4c4bd47606773468d.zip
Rollup merge of #142687 - cjgillot:less-hir_crate, r=oli-obk
Reduce uses of `hir_crate`.

I tried rebasing my old incremental-HIR branch. This is a by-product, which is required if we want to get rid of `hir_crate` entirely.

The second commit is a drive-by cleanup. It can be pulled into its own PR.

r? ````@oli-obk````
Diffstat (limited to 'compiler/rustc_driver_impl')
-rw-r--r--compiler/rustc_driver_impl/src/pretty.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/compiler/rustc_driver_impl/src/pretty.rs b/compiler/rustc_driver_impl/src/pretty.rs
index ec77043cd12..688307a941f 100644
--- a/compiler/rustc_driver_impl/src/pretty.rs
+++ b/compiler/rustc_driver_impl/src/pretty.rs
@@ -292,7 +292,11 @@ pub fn print<'tcx>(sess: &Session, ppm: PpMode, ex: PrintExtra<'tcx>) {
         }
         HirTree => {
             debug!("pretty printing HIR tree");
-            format!("{:#?}", ex.tcx().hir_crate(()))
+            ex.tcx()
+                .hir_crate_items(())
+                .owners()
+                .map(|owner| format!("{:#?} => {:#?}\n", owner, ex.tcx().hir_owner_nodes(owner)))
+                .collect()
         }
         Mir => {
             let mut out = Vec::new();