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
When an outer procedural macro attribute is executed, the provided TokenStream is missing span information for the inner attributes.
Example:
#[repro]#[magic(foo = "bar")]pubfntest(){}
For the above, the repro attribute is a procedural macro attribute. The magic attribute is actually something that the repro attribute respects and strips off when generating the code.
However, the span information for the magic attribute is missing from the TokenStream given to the repro procedural macro attribute.
Overview
When an outer procedural macro attribute is executed, the provided
TokenStream
is missing span information for the inner attributes.Example:
For the above, the
repro
attribute is a procedural macro attribute. Themagic
attribute is actually something that therepro
attribute respects and strips off when generating the code.However, the span information for the
magic
attribute is missing from theTokenStream
given to therepro
procedural macro attribute.Repro Steps
git clone https://github.com/peterhuene/inner-attr-span-repro
cargo build
Expected Results
The inner
magic
attribute has span information in the inputTokenStream
.Actual Results
The inner
magic
attribute has span information that is#0 bytes(0..0)
for all tokens of the inner attribute.This prevents useful diagnostics on the inner attributes since only error messages can be emitted.
System Information
The text was updated successfully, but these errors were encountered: