File tree 1 file changed +3
-7
lines changed
compiler/rustc_ast_lowering/src
1 file changed +3
-7
lines changed Original file line number Diff line number Diff line change @@ -471,6 +471,7 @@ impl<'hir> LoweringContext<'hir> {
471
471
expn_id : ExpnId ,
472
472
span : Span ,
473
473
) -> LocalDefId {
474
+ debug_assert_ne ! ( node_id, ast:: DUMMY_NODE_ID ) ;
474
475
assert ! (
475
476
self . opt_local_def_id( node_id) . is_none( ) ,
476
477
"adding a def'n for node-id {:?} and data {:?} but a previous def'n exists: {:?}" ,
@@ -481,13 +482,8 @@ impl<'hir> LoweringContext<'hir> {
481
482
482
483
let def_id = self . tcx . create_def ( parent, data, expn_id, span) ;
483
484
484
- // Some things for which we allocate `LocalDefId`s don't correspond to
485
- // anything in the AST, so they don't have a `NodeId`. For these cases
486
- // we don't need a mapping from `NodeId` to `LocalDefId`.
487
- if node_id != ast:: DUMMY_NODE_ID {
488
- debug ! ( "create_def: def_id_to_node_id[{:?}] <-> {:?}" , def_id, node_id) ;
489
- self . local_node_id_to_def_id . insert ( node_id, def_id) ;
490
- }
485
+ debug ! ( "create_def: def_id_to_node_id[{:?}] <-> {:?}" , def_id, node_id) ;
486
+ self . local_node_id_to_def_id . insert ( node_id, def_id) ;
491
487
492
488
def_id
493
489
}
You can’t perform that action at this time.
0 commit comments