Skip to content

Commit fb060fb

Browse files
committed
Remove useless branch.
1 parent 250c71b commit fb060fb

File tree

1 file changed

+3
-7
lines changed
  • compiler/rustc_ast_lowering/src

1 file changed

+3
-7
lines changed

compiler/rustc_ast_lowering/src/lib.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -459,6 +459,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
459459
node_id: ast::NodeId,
460460
data: DefPathData,
461461
) -> LocalDefId {
462+
debug_assert_ne!(node_id, ast::DUMMY_NODE_ID);
462463
assert!(
463464
self.opt_local_def_id(node_id).is_none(),
464465
"adding a def'n for node-id {:?} and data {:?} but a previous def'n exists: {:?}",
@@ -469,13 +470,8 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
469470

470471
let def_id = self.tcx.create_def(parent, data);
471472

472-
// Some things for which we allocate `LocalDefId`s don't correspond to
473-
// anything in the AST, so they don't have a `NodeId`. For these cases
474-
// we don't need a mapping from `NodeId` to `LocalDefId`.
475-
if node_id != ast::DUMMY_NODE_ID {
476-
debug!("create_def: def_id_to_node_id[{:?}] <-> {:?}", def_id, node_id);
477-
self.resolver.node_id_to_def_id.insert(node_id, def_id);
478-
}
473+
debug!("create_def: def_id_to_node_id[{:?}] <-> {:?}", def_id, node_id);
474+
self.resolver.node_id_to_def_id.insert(node_id, def_id);
479475

480476
def_id
481477
}

0 commit comments

Comments
 (0)