Closed
Description
In an example like http://is.gd/TKfdKf:
macro_rules! foo {
( $a:tt $($b:tt)* ) => { }
}
fn main() { }
we report the following error:
<anon>:2:11: 2:19 error: `$a:tt` is followed by a sequence repetition, which is not allowed for `tt` fragments
<anon>:2 ( $a:tt $($b:tt)* ) => { }
^~~~~~~~
error: aborting due to previous error
playpen: application terminated with error code 101
This is part of the macro future-proofing code but it is an unnecessary limitation. For fragments that represent at most one token tree (tt
, block
, ident
, possibly others) there is no concern at all about being following by sequence repetition. This turns out to be a really big limitation in practice, since making macros that work over a generic sequence of token trees effectively allows for arbitrary parsing.
cc @pnkfelix
Metadata
Metadata
Assignees
Labels
Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..)Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Medium priority