-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
macro_rules macros should not be serialized through strings in crate metadata. #49511
Comments
This should help with re-exported macro docs #26560 as well. |
triage: P-medium |
In case there is a decision to be made here, seems like clearly "yes", right? Otherwise, I'm not sure why this is nominated, so removing the tag. |
@nikomatsakis I think it was nominated to assign someone to it. |
Here is my last (rather old) attempt at this: branch, previous PR. I was unable to get this to a working state (due to lack of time, and strange issues). |
Triage: it's not clear to me where this lives in the compiler to see if it's something that has been fixed or not; does anyone know where to look? That would help future folks reading this ticket. |
I think merging #66364 should close this issue, because even though I said:
I mean that this is a prerequisite to precise hygiene information, but that is a separate concern that affect all serialized |
Cleanup `rmeta::MacroDef` Avoid using rountrip parsing in the encoder and in `fn load_macro_untracked`. The main reason I was interested in this was to remove `rustc_parse` as a dependency of `rustc_metadata` but it seems like this had other benefits as well. Fixes #49511. r? @eddyb cc @matthewjasper @estebank @petrochenkov
Cleanup `rmeta::MacroDef` Avoid using rountrip parsing in the encoder and in `fn load_macro_untracked`. The main reason I was interested in this was to remove `rustc_parse` as a dependency of `rustc_metadata` but it seems like this had other benefits as well. Fixes #49511. r? @eddyb cc @matthewjasper @estebank @petrochenkov
macro_rules
should useTokenStream
s instead of being pretty-printed into a string and later re-parsed. This is required to get correct/precise hygiene information and original source spans.For example, right now macros from
libstd
get<std macros>
in their spans instead of the original source, and we hide printing any of that source because it looks much worse than the original, and those spans also don't capture any fine-grained information from macro-defining macros.IIRC @ibabushkin started working on this (see #43847) but I couldn't find a tracking issue.
cc @alexcrichton @jseyfried @Manishearth
The text was updated successfully, but these errors were encountered: