From f41537981b84c9490a16c70120df7b41582cd8aa Mon Sep 17 00:00:00 2001 From: r0cky Date: Wed, 6 Mar 2024 22:54:22 +0800 Subject: Add proper cfgs for struct HirIdValidator used only with debug assertions --- compiler/rustc_interface/src/passes.rs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'compiler/rustc_interface/src') diff --git a/compiler/rustc_interface/src/passes.rs b/compiler/rustc_interface/src/passes.rs index 66140168759..84bee457728 100644 --- a/compiler/rustc_interface/src/passes.rs +++ b/compiler/rustc_interface/src/passes.rs @@ -686,6 +686,11 @@ pub fn create_global_ctxt<'tcx>( /// Runs the type-checking, region checking and other miscellaneous analysis /// passes on the crate. fn analysis(tcx: TyCtxt<'_>, (): ()) -> Result<()> { + if tcx.sess.opts.unstable_opts.hir_stats { + rustc_passes::hir_stats::print_hir_stats(tcx); + } + + #[cfg(debug_assertions)] rustc_passes::hir_id_validator::check_crate(tcx); let sess = tcx.sess; -- cgit 1.4.1-3-g733a5