You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#![feature(proc_macro_hygiene)]#[reforest]fnfoo(){macro_rules! m {()=>()}}
All the tokens processed by reforest have their spans set to 0.
You can see this in the warning messages:
warning: unused macro definition
|
= note: #[warn(unused_macros)] on by default
warning: function is never used: `foo`
|
= note: #[warn(dead_code)] on by default
Note that everything is fine we do any of the following:
Change the proc_macro body to item
Change the proc_macro body to TokenStream::from_str(&item.to_string())
Comment out/delete macro_rules! m {()=>()}
The text was updated successfully, but these errors were encountered:
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]fnfoo(){let a = 0;macro_rules! m (() => {});}
(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: