Skip to content

Commit 0d272dd

Browse files
committed
Add proper cfgs for struct HirIdValidator used only with debug assertions
1 parent 2064c19 commit 0d272dd

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

compiler/rustc_passes/src/hir_id_validator.rs

+2
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,15 @@ pub fn check_crate(tcx: TyCtxt<'_>) {
3636
}
3737
}
3838

39+
#[cfg(debug_assertions)]
3940
struct HirIdValidator<'a, 'hir> {
4041
tcx: TyCtxt<'hir>,
4142
owner: Option<hir::OwnerId>,
4243
hir_ids_seen: GrowableBitSet<ItemLocalId>,
4344
errors: &'a Lock<Vec<String>>,
4445
}
4546

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

0 commit comments

Comments
 (0)