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
This commit is a stab at getting the `proc_macro2` crate to function outside the
context of the compiler, **even when the `nightly` feature is enabled**.
Previously when the `nightly` feature was enabled then `proc_macro2` would panic
at runtime because `proc_macro` itself would panic at runtime due to the lack of
the compiler being initialized.
In this commit the `unstable` module in `proc_macro2` no longer unconditionally
uses the `proc_macro` upstream crate but is rather an `enum` over the upstream
crate and the `stable` module. At runtime the appropriate implementation is
dynamically selected depending on which works.
This brings up some uncomfortable issues such as what happens when you try to
psas a "stable span" to a "nightly `Literal`", but I think we can paper over
these issues in time by further canonicalizing everything to nightly/stable if
it comes up.
One caveat this brings up is that `Span::unstable` unconditionally panics when
outside the compiler, but I think that's expected regardless.
0 commit comments