From c6e77b3ba63cc9f824f99b7d356055e22bcf2ae2 Mon Sep 17 00:00:00 2001 From: Camille GILLOT Date: Wed, 18 Jun 2025 15:14:48 +0000 Subject: Reduce uses of `hir_crate`. --- compiler/rustc_driver_impl/src/pretty.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'compiler/rustc_driver_impl') 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(); -- cgit 1.4.1-3-g733a5