Skip to content

Commit

Permalink
Add proper cfgs for struct HirIdValidator used only with debug assert…
Browse files Browse the repository at this point in the history
…ions
  • Loading branch information
mu001999 committed Mar 6, 2024
1 parent 2064c19 commit 0d272dd
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions compiler/rustc_passes/src/hir_id_validator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,15 @@ pub fn check_crate(tcx: TyCtxt<'_>) {
}
}

#[cfg(debug_assertions)]
struct HirIdValidator<'a, 'hir> {
tcx: TyCtxt<'hir>,
owner: Option<hir::OwnerId>,
hir_ids_seen: GrowableBitSet<ItemLocalId>,
errors: &'a Lock<Vec<String>>,
}

#[cfg(debug_assertions)]
impl<'a, 'hir> HirIdValidator<'a, 'hir> {
fn new_visitor(&self, tcx: TyCtxt<'hir>) -> HirIdValidator<'a, 'hir> {
HirIdValidator { tcx, owner: None, hir_ids_seen: Default::default(), errors: self.errors }
Expand Down

0 comments on commit 0d272dd

Please sign in to comment.