rustc_metadata: Remove Span
from ModChild
It can be decoded on demand from regular `def_span` tables. Partially mitigates perf regressions from #109500.
This commit is contained in:
parent
de96f3d873
commit
ec8f68859a
5 changed files with 12 additions and 16 deletions
|
@ -931,7 +931,13 @@ impl<'a, 'b, 'tcx> BuildReducedGraphVisitor<'a, 'b, 'tcx> {
|
|||
/// Builds the reduced graph for a single item in an external crate.
|
||||
fn build_reduced_graph_for_external_crate_res(&mut self, child: ModChild) {
|
||||
let parent = self.parent_scope.module;
|
||||
let ModChild { ident, res, vis, span, .. } = child;
|
||||
let ModChild { ident, res, vis, reexport_chain } = child;
|
||||
let span = self.r.def_span(
|
||||
reexport_chain
|
||||
.first()
|
||||
.and_then(|reexport| reexport.id())
|
||||
.unwrap_or_else(|| res.def_id()),
|
||||
);
|
||||
let res = res.expect_non_local();
|
||||
let expansion = self.parent_scope.expansion;
|
||||
// Record primary definitions.
|
||||
|
|
|
@ -1276,13 +1276,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
|
|||
next_binding = binding;
|
||||
}
|
||||
|
||||
reexports.push(ModChild {
|
||||
ident,
|
||||
res,
|
||||
vis: binding.vis,
|
||||
span: binding.span,
|
||||
reexport_chain,
|
||||
});
|
||||
reexports.push(ModChild { ident, res, vis: binding.vis, reexport_chain });
|
||||
}
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue