diff options
| author | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2023-03-30 17:25:52 +0400 |
|---|---|---|
| committer | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2023-04-18 17:25:04 +0300 |
| commit | ec8f68859a7484d05b42a28ab1b0ece9b2dde629 (patch) | |
| tree | 1f925e90f4f3685267b154e5ae2b6a4c2cab93f7 /compiler/rustc_resolve/src | |
| parent | de96f3d8735b70d5dc1ca178aaee198b329b8f3d (diff) | |
| download | rust-ec8f68859a7484d05b42a28ab1b0ece9b2dde629.tar.gz rust-ec8f68859a7484d05b42a28ab1b0ece9b2dde629.zip | |
rustc_metadata: Remove `Span` from `ModChild`
It can be decoded on demand from regular `def_span` tables. Partially mitigates perf regressions from #109500.
Diffstat (limited to 'compiler/rustc_resolve/src')
| -rw-r--r-- | compiler/rustc_resolve/src/build_reduced_graph.rs | 8 | ||||
| -rw-r--r-- | compiler/rustc_resolve/src/imports.rs | 8 |
2 files changed, 8 insertions, 8 deletions
diff --git a/compiler/rustc_resolve/src/build_reduced_graph.rs b/compiler/rustc_resolve/src/build_reduced_graph.rs index ff0f1f55975..f905cec1011 100644 --- a/compiler/rustc_resolve/src/build_reduced_graph.rs +++ b/compiler/rustc_resolve/src/build_reduced_graph.rs @@ -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. diff --git a/compiler/rustc_resolve/src/imports.rs b/compiler/rustc_resolve/src/imports.rs index 3c22d51c3d4..d7c518fbdd0 100644 --- a/compiler/rustc_resolve/src/imports.rs +++ b/compiler/rustc_resolve/src/imports.rs @@ -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 }); } }); |
