-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Closed
Copy link
Labels
A-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..)C-bugCategory: This is a bug.Category: This is a bug.P-mediumMedium priorityMedium priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
macro_rules
should use TokenStream
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
najamelan and Aaron1011
Metadata
Metadata
Assignees
Labels
A-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..)C-bugCategory: This is a bug.Category: This is a bug.P-mediumMedium priorityMedium priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.