about summary refs log tree commit diff
path: root/compiler/rustc_interface/src
diff options
context:
space:
mode:
authorr0cky <mu001999@outlook.com>2024-03-06 22:54:22 +0800
committerr0cky <mu001999@outlook.com>2024-03-06 22:54:22 +0800
commitf41537981b84c9490a16c70120df7b41582cd8aa (patch)
tree9d49cb36fdb6c54279c066a0ad18710b1bfb178c /compiler/rustc_interface/src
parent2064c19886dbea0eba87d8d05a9cd481bf4b391e (diff)
downloadrust-f41537981b84c9490a16c70120df7b41582cd8aa.tar.gz
rust-f41537981b84c9490a16c70120df7b41582cd8aa.zip
Add proper cfgs for struct HirIdValidator used only with debug assertions
Diffstat (limited to 'compiler/rustc_interface/src')
-rw-r--r--compiler/rustc_interface/src/passes.rs5
1 files changed, 5 insertions, 0 deletions
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;