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
{{ message }}
This repository was archived by the owner on Oct 6, 2024. It is now read-only.
macro_rules! m {(
$lt:lifetime
) => (::paste::item! {impl<$lt> (){}})}m!{'lt }
leads to a parser error saying that:
1.45.0-nightly (90931d9b3 2020-04-28)
error: lifetime in trait object type must be followed by `+`
1.43.0 (3532cf738 2020-03-17)
error: expected type, found `'lt`
A run with cargo bisect seems to indicate this bug has always been present.
EDIT: After some testing, here is a minimal proc-macro repro (that is, if we replace ::paste::item! by foo!, the same parsing error is triggered):
#[proc_macro]pubfnfoo(it:TokenStream) -> TokenStream{
it .into_iter().map(|tt| tt)// without this line, there is no error (I imagine due to some specialization) .collect::<TokenStream>()//.to_string().parse().unwrap() /* workaround! */}
This minimal repro suggests that this is not really an issue with paste, but with some proc-macro :lifetime capture interaction... Since you know the internals of a TokenStream better, @dtolnay, I'll let you investigate it further and post an appropriate issue on rust-lang/rust.