Skip to content

Commit 2341f21

Browse files
committed
Remove useless branch.
1 parent a8921b7 commit 2341f21

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

+3-7
Original file line numberDiff line numberDiff line change
@@ -471,6 +471,7 @@ impl<'hir> LoweringContext<'hir> {
471471
expn_id: ExpnId,
472472
span: Span,
473473
) -> LocalDefId {
474+
debug_assert_ne!(node_id, ast::DUMMY_NODE_ID);
474475
assert!(
475476
self.opt_local_def_id(node_id).is_none(),
476477
"adding a def'n for node-id {:?} and data {:?} but a previous def'n exists: {:?}",
@@ -481,13 +482,8 @@ impl<'hir> LoweringContext<'hir> {
481482

482483
let def_id = self.tcx.create_def(parent, data, expn_id, span);
483484

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);
491487

492488
def_id
493489
}

0 commit comments

Comments
 (0)