Tests on nightly failed as it attempted to use proc_macro2::TokenStream in pub signatures.
Instead of importing proc_macro2 as proc_macro we import either proc_macro or proc_macro2 as tokens and use that as a faux crate name everywhere, so that proc_macro::TokenStream always resolves to the correct, undecorated TokenStream.
Tests on nightly failed as it attempted to use
proc_macro2::TokenStream
in pub signatures.Instead of importing
proc_macro2 as proc_macro
we import eitherproc_macro
orproc_macro2
astokens
and use that as a faux crate name everywhere, so thatproc_macro::TokenStream
always resolves to the correct, undecoratedTokenStream
.