-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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
Spans lost with feature(proc_macro_hygiene)
#55232
Comments
Possibly related to #54727? |
HMPerson1
added a commit
to HMPerson1/rust-clippy
that referenced
this issue
Oct 20, 2018
Closing as a consequence of #43081. For now you only get spans if the input is formatted in the way that rustc's ugly-printer would format it. In the case of macro_rules invocations that would be: #[reforest]
fn foo() {
let a = 0;
macro_rules! m (
() => {}
);
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
(demo: https://github.com/HMPerson1/rustc-macros-span-bug)
If we have a
proc_macro
like this:And we invoke it like this:
All the tokens processed by
reforest
have their spans set to 0.You can see this in the warning messages:
Note that everything is fine we do any of the following:
item
TokenStream::from_str(&item.to_string())
macro_rules! m {()=>()}
The text was updated successfully, but these errors were encountered: