@@ -207,26 +207,24 @@ pub struct LocalTableInContext<'a, V> {
207
207
fn validate_hir_id_for_typeck_tables ( local_id_root : Option < DefId > ,
208
208
hir_id : hir:: HirId ,
209
209
mut_access : bool ) {
210
- if cfg ! ( debug_assertions) {
211
- if let Some ( local_id_root) = local_id_root {
212
- if hir_id. owner != local_id_root. index {
213
- ty:: tls:: with ( |tcx| {
214
- bug ! ( "node {} with HirId::owner {:?} cannot be placed in \
215
- TypeckTables with local_id_root {:?}",
216
- tcx. hir( ) . node_to_string( hir_id) ,
217
- DefId :: local( hir_id. owner) ,
218
- local_id_root)
219
- } ) ;
220
- }
221
- } else {
222
- // We use "Null Object" TypeckTables in some of the analysis passes.
223
- // These are just expected to be empty and their `local_id_root` is
224
- // `None`. Therefore we cannot verify whether a given `HirId` would
225
- // be a valid key for the given table. Instead we make sure that
226
- // nobody tries to write to such a Null Object table.
227
- if mut_access {
228
- bug ! ( "access to invalid TypeckTables" )
229
- }
210
+ if let Some ( local_id_root) = local_id_root {
211
+ if hir_id. owner != local_id_root. index {
212
+ ty:: tls:: with ( |tcx| {
213
+ bug ! ( "node {} with HirId::owner {:?} cannot be placed in \
214
+ TypeckTables with local_id_root {:?}",
215
+ tcx. hir( ) . node_to_string( hir_id) ,
216
+ DefId :: local( hir_id. owner) ,
217
+ local_id_root)
218
+ } ) ;
219
+ }
220
+ } else {
221
+ // We use "Null Object" TypeckTables in some of the analysis passes.
222
+ // These are just expected to be empty and their `local_id_root` is
223
+ // `None`. Therefore we cannot verify whether a given `HirId` would
224
+ // be a valid key for the given table. Instead we make sure that
225
+ // nobody tries to write to such a Null Object table.
226
+ if mut_access {
227
+ bug ! ( "access to invalid TypeckTables" )
230
228
}
231
229
}
232
230
}
0 commit comments