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 has been archived by the owner on Oct 6, 2024. It is now read-only.
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.
The text was updated successfully, but these errors were encountered:
For those needing a workaround, "flattening" / unwrapping the Grouped :lifetime into the two tokens that compose it seems to solve the issue. That is, wrapping the returned TokenStream within the following function avoids the compilation error:
Minimal repro:
leads to a parser error saying that:
1.45.0-nightly (90931d9b3 2020-04-28)
1.43.0 (3532cf738 2020-03-17)
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!
byfoo!
, the same parsing error is triggered):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 aTokenStream
better, @dtolnay, I'll let you investigate it further and post an appropriate issue on rust-lang/rust.The text was updated successfully, but these errors were encountered: