Skip to content

Commit 9e27717

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

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

compiler/rustc_passes/src/hir_id_validator.rs

+3
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 }
@@ -114,6 +116,7 @@ impl<'a, 'hir> HirIdValidator<'a, 'hir> {
114116
}
115117
}
116118

119+
#[cfg(debug_assertions)]
117120
impl<'a, 'hir> intravisit::Visitor<'hir> for HirIdValidator<'a, 'hir> {
118121
type NestedFilter = nested_filter::OnlyBodies;
119122

0 commit comments

Comments
 (0)