Open oli-obk opened 3 years ago
someone remind me why we need spans in metadata at all?
I believe the main use is for diagnostics. For macro_rules!
macros, we need to preserve spans of tokens for correctness (this is especially important when a macro_rules!
macro is generated by another macro).
ok... so DefKind::Macro(_)
may be the only real user of this, though errors pointing into locally built crates may be improved by it.
I guess let's try to get the previous status quo reestablished first, not emitting Spans for things that don't need them.
someone remind me why we need spans in metadata at all?
I am wondering the same thing for ident_span
.
Those are used for one diagnostic, and to create the Ident
for imported items.
It's not clear to me whether the latter uses are semantic or diagnostic.
In contrast, there is a report of a missing def_span
in #81540 (using rustc before changes in question landed).
Hmm... so this perf regression may in fact be due to a bugfix
There were some perf regressions due #80191 can be seen here
Originally posted by @rylev in https://github.com/rust-lang/rust/issues/80919#issuecomment-767854932
We need to find out which kind (as what variant of
def_kind
) of things now get theirdef_span
encoded and stop doing that.Bonus points for also checking which additional
DefKind
s we can exclude to minimize the amount of spans that are put into metadata (someone remind me why we need spans in metadata at all?)