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