Add proper cfgs for struct HirIdValidator used only with debug assertions

This commit is contained in:
r0cky 2024-03-06 22:54:22 +08:00
parent 2064c19886
commit f41537981b
3 changed files with 18 additions and 24 deletions

View file

@ -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;