Code change:
#![allow(unused_macros)] <ins> // Tests that repetition matchers cannot match the empty token tree (since that would be // ambiguous). // edition:2018 </ins> macro_rules! foo { ( $()* ) => {}; //~^ ERROR repetition matches empty token tree ( $()+ ) => {}; //~^ ERROR repetition matches empty token tree <ins> ( $()? ) => {}; //~^ ERROR repetition matches empty token tree </ins> ( $(),* ) => {}; // PASS ( $(),+ ) => {}; // PASS <ins> // `?` cannot have a separator... </ins> ( [$()*] ) => {}; //~^ ERROR repetition matches empty token tree ( [$()+] ) => {}; //~^ ERROR repetition matches empty token tree <ins> ( [$()?] ) => {}; //~^ ERROR repetition matches empty token tree </ins> ( [$(),*] ) => {}; // PASS ( [$(),+] ) => {}; // PASS <ins> // `?` cannot have a separator... </ins> ( $($()* $(),* $(a)* $(a),* )* ) => {}; //~^ ERROR repetition matches empty token tree ( $($()* $(),* $(a)* $(a),* )+ ) => {}; //~^ ERROR repetition matches empty token tree <ins> ( $($()* $(),* $(a)* $(a),* )? ) => {}; //~^ ERROR repetition matches empty token tree ( $($()? $(),* $(a)? $(a),* )* ) => {}; //~^ ERROR repetition matches empty token tree ( $($()? $(),* $(a)? $(a),* )+ ) => {}; //~^ ERROR repetition matches empty token tree ( $($()? $(),* $(a)? $(a),* )? ) => {}; //~^ ERROR repetition matches empty token tree </ins> ( $(a     $(),* $(a)* $(a),* )* ) => {}; // PASS ( $($(a)+ $(),* $(a)* $(a),* )+ ) => {}; // PASS <ins> ( $($(a)+ $(),* $(a)* $(a),* )? ) => {}; // PASS ( $(a     $(),* $(a)? $(a),* )* ) => {}; // PASS ( $($(a)+ $(),* $(a)? $(a),* )+ ) => {}; // PASS ( $($(a)+ $(),* $(a)? $(a),* )? ) => {}; // PASS </ins> ( $(a $()+)* ) => {}; //~^ ERROR repetition matches empty token tree ( $(a $()*)+ ) => {}; //~^ ERROR repetition matches empty token tree <ins> ( $(a $()+)? ) => {}; //~^ ERROR repetition matches empty token tree ( $(a $()?)+ ) => {}; //~^ ERROR repetition matches empty token tree </ins> } // --- Original Issue --- // macro_rules! make_vec {

Related discussion:
text: The following code will cause the compiler to fail: Playground link: It should error that the inner matcher can match an empty string and reject it, just as it does if is used in place of .
The fix should be very easy, since this was already fixed for repetitions in (original bug: ): Looks like just needs to be checked against , too.
cc
Note that with on the outside, this errors properly, although with inconsistent error messages: if the inner repetition uses only, the error is "repetition matches empty token tree", but it seems that if any of the repetitions are , then the error is "multiple successful parses".
The behaviour in my previous comment is because the check for "repetition matches empty token tree" is done at definition time, but does not catch ; this is caught at expansion time however. Ideally all of this will be moved to definition time and the expansion-time check should probably be a) corrected to address the first comment and b) possibly become an ICE, since it should never be encountered since the RFC 550 rules should eliminate all ambiguity at definition time?
Hmm... I don't really remember how most of this code works... Just grepping, but it looks like there are a couple of other places we might want to look at:
I've opened