Remove useless branch.
This commit is contained in:
parent
250c71b85d
commit
fb060fb774
@ -459,6 +459,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
|
|||||||
node_id: ast::NodeId,
|
node_id: ast::NodeId,
|
||||||
data: DefPathData,
|
data: DefPathData,
|
||||||
) -> LocalDefId {
|
) -> LocalDefId {
|
||||||
|
debug_assert_ne!(node_id, ast::DUMMY_NODE_ID);
|
||||||
assert!(
|
assert!(
|
||||||
self.opt_local_def_id(node_id).is_none(),
|
self.opt_local_def_id(node_id).is_none(),
|
||||||
"adding a def'n for node-id {:?} and data {:?} but a previous def'n exists: {:?}",
|
"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> {
|
|||||||
|
|
||||||
let def_id = self.tcx.create_def(parent, data);
|
let def_id = self.tcx.create_def(parent, data);
|
||||||
|
|
||||||
// Some things for which we allocate `LocalDefId`s don't correspond to
|
|
||||||
// anything in the AST, so they don't have a `NodeId`. For these cases
|
|
||||||
// we don't need a mapping from `NodeId` to `LocalDefId`.
|
|
||||||
if node_id != ast::DUMMY_NODE_ID {
|
|
||||||
debug!("create_def: def_id_to_node_id[{:?}] <-> {:?}", def_id, node_id);
|
debug!("create_def: def_id_to_node_id[{:?}] <-> {:?}", def_id, node_id);
|
||||||
self.resolver.node_id_to_def_id.insert(node_id, def_id);
|
self.resolver.node_id_to_def_id.insert(node_id, def_id);
|
||||||
}
|
|
||||||
|
|
||||||
def_id
|
def_id
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user