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
Stop emitting spans from proc macro compile time in quote expansion
Before this commit if the proc_macro::quote!{} macro was used, the span
of each token as written in the source of the proc macro itself would be
saved in the crate metadata of the proc macro and then recovered at proc
macro runtime to forward this to the macro expansion of the proc macro.
This commit stops doing this and instead generates def-site spans for
each token. This removes the only case where spans from the proc macro
source have a semantic effect on the compilation of crates that use the
proc macro. This makes it easier to stop requiring all dependencies of
proc macros to be present when using the proc macro. And will make it
easier to stop requiring a proc macro to be present when using a crate
that used this proc macro internally but doesn't expose it as part of
it's public api. The latter is necessary to be able to cross-compile
tools that link against rustc internals without requiring to be built as
part of rustc with the -Zdual-proc-macro hack. It may also enable using
proc macros inside the standard library or it's dependencies without
breaking cross-compilation.
0 commit comments