Auto merge of #109772 - petrochenkov:slimchild, r=cjgillot
rustc_metadata: Remove `Span` from `ModChild` It can be decoded on demand from regular `def_span` tables. Partially mitigates perf regressions from https://github.com/rust-lang/rust/pull/109500.
This commit is contained in:
commit
c609da59d9
5 changed files with 12 additions and 16 deletions
|
@ -998,9 +998,8 @@ impl<'a, 'tcx> CrateMetadataRef<'a> {
|
|||
let ident = self.item_ident(id, sess);
|
||||
let res = Res::Def(self.def_kind(id), self.local_def_id(id));
|
||||
let vis = self.get_visibility(id);
|
||||
let span = self.get_span(id, sess);
|
||||
|
||||
ModChild { ident, res, vis, span, reexport_chain: Default::default() }
|
||||
ModChild { ident, res, vis, reexport_chain: Default::default() }
|
||||
}
|
||||
|
||||
/// Iterates over all named children of the given module,
|
||||
|
|
|
@ -831,6 +831,8 @@ fn should_encode_span(def_kind: DefKind) -> bool {
|
|||
| DefKind::AssocFn
|
||||
| DefKind::AssocConst
|
||||
| DefKind::Macro(_)
|
||||
| DefKind::ExternCrate
|
||||
| DefKind::Use
|
||||
| DefKind::AnonConst
|
||||
| DefKind::InlineConst
|
||||
| DefKind::OpaqueTy
|
||||
|
@ -838,9 +840,7 @@ fn should_encode_span(def_kind: DefKind) -> bool {
|
|||
| DefKind::Impl { .. }
|
||||
| DefKind::Closure
|
||||
| DefKind::Generator => true,
|
||||
DefKind::ExternCrate
|
||||
| DefKind::Use
|
||||
| DefKind::ForeignMod
|
||||
DefKind::ForeignMod
|
||||
| DefKind::ImplTraitPlaceholder
|
||||
| DefKind::LifetimeParam
|
||||
| DefKind::GlobalAsm => false,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue