From 236cf94ddb291ebda3d07e463b8fde1502e7a4c7 Mon Sep 17 00:00:00 2001 From: Noa Date: Thu, 3 Sep 2026 17:04:56 -0500 Subject: [PATCH 1/3] Allow `:` after `pat_param` --- compiler/rustc_expand/src/mbe/macro_rules.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/compiler/rustc_expand/src/mbe/macro_rules.rs b/compiler/rustc_expand/src/mbe/macro_rules.rs index d762763b8dcea..72be9ddea776e 100644 --- a/compiler/rustc_expand/src/mbe/macro_rules.rs +++ b/compiler/rustc_expand/src/mbe/macro_rules.rs @@ -1628,7 +1628,8 @@ fn check_matcher_core<'tt>( if kind == NonterminalKind::Pat(PatWithOr) && sess.psess.edition.at_least_rust_2021() - && next_token.is_token(&token::Or) + && (next_token.is_token(&token::Or) + || next_token.is_token(&token::Colon)) { let suggestion = quoted_tt_to_string(&TokenTree::MetaVarDecl { span, @@ -1746,10 +1747,11 @@ fn is_in_follow(tok: &mbe::TokenTree, kind: NonterminalKind) -> IsInFollow { } } NonterminalKind::Pat(PatParam { .. }) => { - const TOKENS: &[&str] = &["`=>`", "`,`", "`=`", "`|`", "`if`", "`if let`", "`in`"]; + const TOKENS: &[&str] = + &["`=>`", "`,`", "`=`", "`|`", "`:`", "`if`", "`if let`", "`in`"]; match tok { TokenTree::Token(token) => match token.kind { - FatArrow | Comma | Eq | Or => IsInFollow::Yes, + FatArrow | Comma | Eq | Or | Colon => IsInFollow::Yes, Ident(name, IdentKind::Normal) if name == kw::If || name == kw::In => { IsInFollow::Yes } From b29ec3f64b1aff8fee5a5fa48139d0e2fc1f93b0 Mon Sep 17 00:00:00 2001 From: Noa Date: Wed, 23 Sep 2026 14:30:27 -0500 Subject: [PATCH 2/3] Restrict to only explicit pat_param --- compiler/rustc_expand/src/mbe/macro_rules.rs | 23 +++++++++++++------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/compiler/rustc_expand/src/mbe/macro_rules.rs b/compiler/rustc_expand/src/mbe/macro_rules.rs index 72be9ddea776e..f81123ac401e4 100644 --- a/compiler/rustc_expand/src/mbe/macro_rules.rs +++ b/compiler/rustc_expand/src/mbe/macro_rules.rs @@ -1627,8 +1627,8 @@ fn check_matcher_core<'tt>( err.span_label(sp, format!("not allowed after `{kind}` fragments")); if kind == NonterminalKind::Pat(PatWithOr) - && sess.psess.edition.at_least_rust_2021() - && (next_token.is_token(&token::Or) + && ((sess.psess.edition.at_least_rust_2021() + && next_token.is_token(&token::Or)) || next_token.is_token(&token::Colon)) { let suggestion = quoted_tt_to_string(&TokenTree::MetaVarDecl { @@ -1746,19 +1746,26 @@ fn is_in_follow(tok: &mbe::TokenTree, kind: NonterminalKind) -> IsInFollow { _ => IsInFollow::No(TOKENS), } } - NonterminalKind::Pat(PatParam { .. }) => { - const TOKENS: &[&str] = - &["`=>`", "`,`", "`=`", "`|`", "`:`", "`if`", "`if let`", "`in`"]; + NonterminalKind::Pat(PatParam { inferred }) => { + let explicit = !inferred; + // only allow `:` after explicit `pat_param` matchers, + // not after edition2015 `pat` + let tokens: &[&str] = if explicit { + &["`=>`", "`,`", "`=`", "`|`", "`:`", "`if`", "`if let`", "`in`"] + } else { + &["`=>`", "`,`", "`=`", "`|`", "`if`", "`if let`", "`in`"] + }; match tok { TokenTree::Token(token) => match token.kind { - FatArrow | Comma | Eq | Or | Colon => IsInFollow::Yes, + FatArrow | Comma | Eq | Or => IsInFollow::Yes, + Colon if explicit => IsInFollow::Yes, Ident(name, IdentKind::Normal) if name == kw::If || name == kw::In => { IsInFollow::Yes } - _ => IsInFollow::No(TOKENS), + _ => IsInFollow::No(tokens), }, TokenTree::MetaVarDecl { kind: NonterminalKind::Guard, .. } => IsInFollow::Yes, - _ => IsInFollow::No(TOKENS), + _ => IsInFollow::No(tokens), } } NonterminalKind::Pat(PatWithOr) => { From 9aff302be19a8b7f458281f9355bc531cd89650b Mon Sep 17 00:00:00 2001 From: Noa Date: Wed, 23 Sep 2026 14:43:23 -0500 Subject: [PATCH 3/3] Update UI tests --- tests/ui/macros/macro-follow.rs | 20 ++ tests/ui/macros/macro-follow.stderr | 274 ++++++++++++++++++++-------- 2 files changed, 221 insertions(+), 73 deletions(-) diff --git a/tests/ui/macros/macro-follow.rs b/tests/ui/macros/macro-follow.rs index cf83a9ad734bd..7090c57e9262d 100644 --- a/tests/ui/macros/macro-follow.rs +++ b/tests/ui/macros/macro-follow.rs @@ -27,6 +27,26 @@ macro_rules! follow_pat { ($p:pat $i:item) => {}; //~ERROR `$p:pat` is followed by `$i:item` ($p:pat $m:meta) => {}; //~ERROR `$p:pat` is followed by `$m:meta` } +// FOLLOW(pat_param) = {FOLLOW(pat), Colon} +macro_rules! follow_pat { + ($p:pat_param ()) => {}; //~ERROR `$p:pat_param` is followed by `(` + ($p:pat_param []) => {}; //~ERROR `$p:pat_param` is followed by `[` + ($p:pat_param {}) => {}; //~ERROR `$p:pat_param` is followed by `{` + ($p:pat_param :) => {}; // ok + ($p:pat_param >) => {}; //~ERROR `$p:pat_param` is followed by `>` + ($p:pat_param +) => {}; //~ERROR `$p:pat_param` is followed by `+` + ($p:pat_param ident) => {}; //~ERROR `$p:pat_param` is followed by `ident` + ($p:pat_param $q:pat) => {}; //~ERROR `$p:pat_param` is followed by `$q:pat` + ($p:pat_param $e:expr) => {}; //~ERROR `$p:pat_param` is followed by `$e:expr` + ($p:pat_param $t:ty) => {}; //~ERROR `$p:pat_param` is followed by `$t:ty` + ($p:pat_param $s:stmt) => {}; //~ERROR `$p:pat_param` is followed by `$s:stmt` + ($p:pat_param $q:path) => {}; //~ERROR `$p:pat_param` is followed by `$q:path` + ($p:pat_param $b:block) => {}; //~ERROR `$p:pat_param` is followed by `$b:block` + ($p:pat_param $i:ident) => {}; //~ERROR `$p:pat_param` is followed by `$i:ident` + ($p:pat_param $t:tt) => {}; //~ERROR `$p:pat_param` is followed by `$t:tt` + ($p:pat_param $i:item) => {}; //~ERROR `$p:pat_param` is followed by `$i:item` + ($p:pat_param $m:meta) => {}; //~ERROR `$p:pat_param` is followed by `$m:meta` +} // FOLLOW(expr) = {FatArrow, Comma, Semicolon} macro_rules! follow_expr { ($e:expr ()) => {}; //~ERROR `$e:expr` is followed by `(` diff --git a/tests/ui/macros/macro-follow.stderr b/tests/ui/macros/macro-follow.stderr index 64a916b4c227a..433e55f903c2e 100644 --- a/tests/ui/macros/macro-follow.stderr +++ b/tests/ui/macros/macro-follow.stderr @@ -134,8 +134,136 @@ LL | ($p:pat $m:meta) => {}; | = note: allowed there are: `=>`, `,`, `=`, `|`, `if`, `if let` or `in` +error: `$p:pat_param` is followed by `(`, which is not allowed for `pat_param` fragments + --> $DIR/macro-follow.rs:32:19 + | +LL | ($p:pat_param ()) => {}; + | ^ not allowed after `pat_param` fragments + | + = note: allowed there are: `=>`, `,`, `=`, `|`, `:`, `if`, `if let` or `in` + +error: `$p:pat_param` is followed by `[`, which is not allowed for `pat_param` fragments + --> $DIR/macro-follow.rs:33:19 + | +LL | ($p:pat_param []) => {}; + | ^ not allowed after `pat_param` fragments + | + = note: allowed there are: `=>`, `,`, `=`, `|`, `:`, `if`, `if let` or `in` + +error: `$p:pat_param` is followed by `{`, which is not allowed for `pat_param` fragments + --> $DIR/macro-follow.rs:34:19 + | +LL | ($p:pat_param {}) => {}; + | ^ not allowed after `pat_param` fragments + | + = note: allowed there are: `=>`, `,`, `=`, `|`, `:`, `if`, `if let` or `in` + +error: `$p:pat_param` is followed by `>`, which is not allowed for `pat_param` fragments + --> $DIR/macro-follow.rs:36:19 + | +LL | ($p:pat_param >) => {}; + | ^ not allowed after `pat_param` fragments + | + = note: allowed there are: `=>`, `,`, `=`, `|`, `:`, `if`, `if let` or `in` + +error: `$p:pat_param` is followed by `+`, which is not allowed for `pat_param` fragments + --> $DIR/macro-follow.rs:37:19 + | +LL | ($p:pat_param +) => {}; + | ^ not allowed after `pat_param` fragments + | + = note: allowed there are: `=>`, `,`, `=`, `|`, `:`, `if`, `if let` or `in` + +error: `$p:pat_param` is followed by `ident`, which is not allowed for `pat_param` fragments + --> $DIR/macro-follow.rs:38:19 + | +LL | ($p:pat_param ident) => {}; + | ^^^^^ not allowed after `pat_param` fragments + | + = note: allowed there are: `=>`, `,`, `=`, `|`, `:`, `if`, `if let` or `in` + +error: `$p:pat_param` is followed by `$q:pat`, which is not allowed for `pat_param` fragments + --> $DIR/macro-follow.rs:39:19 + | +LL | ($p:pat_param $q:pat) => {}; + | ^^^^^^ not allowed after `pat_param` fragments + | + = note: allowed there are: `=>`, `,`, `=`, `|`, `:`, `if`, `if let` or `in` + +error: `$p:pat_param` is followed by `$e:expr`, which is not allowed for `pat_param` fragments + --> $DIR/macro-follow.rs:40:19 + | +LL | ($p:pat_param $e:expr) => {}; + | ^^^^^^^ not allowed after `pat_param` fragments + | + = note: allowed there are: `=>`, `,`, `=`, `|`, `:`, `if`, `if let` or `in` + +error: `$p:pat_param` is followed by `$t:ty`, which is not allowed for `pat_param` fragments + --> $DIR/macro-follow.rs:41:19 + | +LL | ($p:pat_param $t:ty) => {}; + | ^^^^^ not allowed after `pat_param` fragments + | + = note: allowed there are: `=>`, `,`, `=`, `|`, `:`, `if`, `if let` or `in` + +error: `$p:pat_param` is followed by `$s:stmt`, which is not allowed for `pat_param` fragments + --> $DIR/macro-follow.rs:42:19 + | +LL | ($p:pat_param $s:stmt) => {}; + | ^^^^^^^ not allowed after `pat_param` fragments + | + = note: allowed there are: `=>`, `,`, `=`, `|`, `:`, `if`, `if let` or `in` + +error: `$p:pat_param` is followed by `$q:path`, which is not allowed for `pat_param` fragments + --> $DIR/macro-follow.rs:43:19 + | +LL | ($p:pat_param $q:path) => {}; + | ^^^^^^^ not allowed after `pat_param` fragments + | + = note: allowed there are: `=>`, `,`, `=`, `|`, `:`, `if`, `if let` or `in` + +error: `$p:pat_param` is followed by `$b:block`, which is not allowed for `pat_param` fragments + --> $DIR/macro-follow.rs:44:19 + | +LL | ($p:pat_param $b:block) => {}; + | ^^^^^^^^ not allowed after `pat_param` fragments + | + = note: allowed there are: `=>`, `,`, `=`, `|`, `:`, `if`, `if let` or `in` + +error: `$p:pat_param` is followed by `$i:ident`, which is not allowed for `pat_param` fragments + --> $DIR/macro-follow.rs:45:19 + | +LL | ($p:pat_param $i:ident) => {}; + | ^^^^^^^^ not allowed after `pat_param` fragments + | + = note: allowed there are: `=>`, `,`, `=`, `|`, `:`, `if`, `if let` or `in` + +error: `$p:pat_param` is followed by `$t:tt`, which is not allowed for `pat_param` fragments + --> $DIR/macro-follow.rs:46:19 + | +LL | ($p:pat_param $t:tt) => {}; + | ^^^^^ not allowed after `pat_param` fragments + | + = note: allowed there are: `=>`, `,`, `=`, `|`, `:`, `if`, `if let` or `in` + +error: `$p:pat_param` is followed by `$i:item`, which is not allowed for `pat_param` fragments + --> $DIR/macro-follow.rs:47:19 + | +LL | ($p:pat_param $i:item) => {}; + | ^^^^^^^ not allowed after `pat_param` fragments + | + = note: allowed there are: `=>`, `,`, `=`, `|`, `:`, `if`, `if let` or `in` + +error: `$p:pat_param` is followed by `$m:meta`, which is not allowed for `pat_param` fragments + --> $DIR/macro-follow.rs:48:19 + | +LL | ($p:pat_param $m:meta) => {}; + | ^^^^^^^ not allowed after `pat_param` fragments + | + = note: allowed there are: `=>`, `,`, `=`, `|`, `:`, `if`, `if let` or `in` + error: `$e:expr` is followed by `(`, which is not allowed for `expr` fragments - --> $DIR/macro-follow.rs:32:14 + --> $DIR/macro-follow.rs:52:14 | LL | ($e:expr ()) => {}; | ^ not allowed after `expr` fragments @@ -143,7 +271,7 @@ LL | ($e:expr ()) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$e:expr` is followed by `[`, which is not allowed for `expr` fragments - --> $DIR/macro-follow.rs:33:14 + --> $DIR/macro-follow.rs:53:14 | LL | ($e:expr []) => {}; | ^ not allowed after `expr` fragments @@ -151,7 +279,7 @@ LL | ($e:expr []) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$e:expr` is followed by `{`, which is not allowed for `expr` fragments - --> $DIR/macro-follow.rs:34:14 + --> $DIR/macro-follow.rs:54:14 | LL | ($e:expr {}) => {}; | ^ not allowed after `expr` fragments @@ -159,7 +287,7 @@ LL | ($e:expr {}) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$e:expr` is followed by `=`, which is not allowed for `expr` fragments - --> $DIR/macro-follow.rs:35:14 + --> $DIR/macro-follow.rs:55:14 | LL | ($e:expr =) => {}; | ^ not allowed after `expr` fragments @@ -167,7 +295,7 @@ LL | ($e:expr =) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$e:expr` is followed by `|`, which is not allowed for `expr` fragments - --> $DIR/macro-follow.rs:36:14 + --> $DIR/macro-follow.rs:56:14 | LL | ($e:expr |) => {}; | ^ not allowed after `expr` fragments @@ -175,7 +303,7 @@ LL | ($e:expr |) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$e:expr` is followed by `:`, which is not allowed for `expr` fragments - --> $DIR/macro-follow.rs:37:14 + --> $DIR/macro-follow.rs:57:14 | LL | ($e:expr :) => {}; | ^ not allowed after `expr` fragments @@ -183,7 +311,7 @@ LL | ($e:expr :) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$e:expr` is followed by `>`, which is not allowed for `expr` fragments - --> $DIR/macro-follow.rs:38:14 + --> $DIR/macro-follow.rs:58:14 | LL | ($e:expr >) => {}; | ^ not allowed after `expr` fragments @@ -191,7 +319,7 @@ LL | ($e:expr >) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$e:expr` is followed by `+`, which is not allowed for `expr` fragments - --> $DIR/macro-follow.rs:39:14 + --> $DIR/macro-follow.rs:59:14 | LL | ($e:expr +) => {}; | ^ not allowed after `expr` fragments @@ -199,7 +327,7 @@ LL | ($e:expr +) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$e:expr` is followed by `ident`, which is not allowed for `expr` fragments - --> $DIR/macro-follow.rs:40:14 + --> $DIR/macro-follow.rs:60:14 | LL | ($e:expr ident) => {}; | ^^^^^ not allowed after `expr` fragments @@ -207,7 +335,7 @@ LL | ($e:expr ident) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$e:expr` is followed by `if`, which is not allowed for `expr` fragments - --> $DIR/macro-follow.rs:41:14 + --> $DIR/macro-follow.rs:61:14 | LL | ($e:expr if) => {}; | ^^ not allowed after `expr` fragments @@ -215,7 +343,7 @@ LL | ($e:expr if) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$e:expr` is followed by `in`, which is not allowed for `expr` fragments - --> $DIR/macro-follow.rs:42:14 + --> $DIR/macro-follow.rs:62:14 | LL | ($e:expr in) => {}; | ^^ not allowed after `expr` fragments @@ -223,7 +351,7 @@ LL | ($e:expr in) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$e:expr` is followed by `$p:pat`, which is not allowed for `expr` fragments - --> $DIR/macro-follow.rs:43:14 + --> $DIR/macro-follow.rs:63:14 | LL | ($e:expr $p:pat) => {}; | ^^^^^^ not allowed after `expr` fragments @@ -231,7 +359,7 @@ LL | ($e:expr $p:pat) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$e:expr` is followed by `$f:expr`, which is not allowed for `expr` fragments - --> $DIR/macro-follow.rs:44:14 + --> $DIR/macro-follow.rs:64:14 | LL | ($e:expr $f:expr) => {}; | ^^^^^^^ not allowed after `expr` fragments @@ -239,7 +367,7 @@ LL | ($e:expr $f:expr) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$e:expr` is followed by `$t:ty`, which is not allowed for `expr` fragments - --> $DIR/macro-follow.rs:45:14 + --> $DIR/macro-follow.rs:65:14 | LL | ($e:expr $t:ty) => {}; | ^^^^^ not allowed after `expr` fragments @@ -247,7 +375,7 @@ LL | ($e:expr $t:ty) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$e:expr` is followed by `$s:stmt`, which is not allowed for `expr` fragments - --> $DIR/macro-follow.rs:46:14 + --> $DIR/macro-follow.rs:66:14 | LL | ($e:expr $s:stmt) => {}; | ^^^^^^^ not allowed after `expr` fragments @@ -255,7 +383,7 @@ LL | ($e:expr $s:stmt) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$e:expr` is followed by `$p:path`, which is not allowed for `expr` fragments - --> $DIR/macro-follow.rs:47:14 + --> $DIR/macro-follow.rs:67:14 | LL | ($e:expr $p:path) => {}; | ^^^^^^^ not allowed after `expr` fragments @@ -263,7 +391,7 @@ LL | ($e:expr $p:path) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$e:expr` is followed by `$b:block`, which is not allowed for `expr` fragments - --> $DIR/macro-follow.rs:48:14 + --> $DIR/macro-follow.rs:68:14 | LL | ($e:expr $b:block) => {}; | ^^^^^^^^ not allowed after `expr` fragments @@ -271,7 +399,7 @@ LL | ($e:expr $b:block) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$e:expr` is followed by `$i:ident`, which is not allowed for `expr` fragments - --> $DIR/macro-follow.rs:49:14 + --> $DIR/macro-follow.rs:69:14 | LL | ($e:expr $i:ident) => {}; | ^^^^^^^^ not allowed after `expr` fragments @@ -279,7 +407,7 @@ LL | ($e:expr $i:ident) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$e:expr` is followed by `$t:tt`, which is not allowed for `expr` fragments - --> $DIR/macro-follow.rs:50:14 + --> $DIR/macro-follow.rs:70:14 | LL | ($e:expr $t:tt) => {}; | ^^^^^ not allowed after `expr` fragments @@ -287,7 +415,7 @@ LL | ($e:expr $t:tt) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$e:expr` is followed by `$i:item`, which is not allowed for `expr` fragments - --> $DIR/macro-follow.rs:51:14 + --> $DIR/macro-follow.rs:71:14 | LL | ($e:expr $i:item) => {}; | ^^^^^^^ not allowed after `expr` fragments @@ -295,7 +423,7 @@ LL | ($e:expr $i:item) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$e:expr` is followed by `$m:meta`, which is not allowed for `expr` fragments - --> $DIR/macro-follow.rs:52:14 + --> $DIR/macro-follow.rs:72:14 | LL | ($e:expr $m:meta) => {}; | ^^^^^^^ not allowed after `expr` fragments @@ -303,7 +431,7 @@ LL | ($e:expr $m:meta) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$e:expr` is followed by `$g:guard`, which is not allowed for `expr` fragments - --> $DIR/macro-follow.rs:53:14 + --> $DIR/macro-follow.rs:73:14 | LL | ($e:expr $g:guard) => {}; | ^^^^^^^^ not allowed after `expr` fragments @@ -311,7 +439,7 @@ LL | ($e:expr $g:guard) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$t:ty` is followed by `(`, which is not allowed for `ty` fragments - --> $DIR/macro-follow.rs:58:12 + --> $DIR/macro-follow.rs:78:12 | LL | ($t:ty ()) => {}; | ^ not allowed after `ty` fragments @@ -319,7 +447,7 @@ LL | ($t:ty ()) => {}; = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as` or `where` error: `$t:ty` is followed by `+`, which is not allowed for `ty` fragments - --> $DIR/macro-follow.rs:60:12 + --> $DIR/macro-follow.rs:80:12 | LL | ($t:ty +) => {}; | ^ not allowed after `ty` fragments @@ -327,7 +455,7 @@ LL | ($t:ty +) => {}; = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as` or `where` error: `$t:ty` is followed by `ident`, which is not allowed for `ty` fragments - --> $DIR/macro-follow.rs:61:12 + --> $DIR/macro-follow.rs:81:12 | LL | ($t:ty ident) => {}; | ^^^^^ not allowed after `ty` fragments @@ -335,7 +463,7 @@ LL | ($t:ty ident) => {}; = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as` or `where` error: `$t:ty` is followed by `if`, which is not allowed for `ty` fragments - --> $DIR/macro-follow.rs:62:12 + --> $DIR/macro-follow.rs:82:12 | LL | ($t:ty if) => {}; | ^^ not allowed after `ty` fragments @@ -343,7 +471,7 @@ LL | ($t:ty if) => {}; = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as` or `where` error: `$t:ty` is followed by `$p:pat`, which is not allowed for `ty` fragments - --> $DIR/macro-follow.rs:63:12 + --> $DIR/macro-follow.rs:83:12 | LL | ($t:ty $p:pat) => {}; | ^^^^^^ not allowed after `ty` fragments @@ -351,7 +479,7 @@ LL | ($t:ty $p:pat) => {}; = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as` or `where` error: `$t:ty` is followed by `$e:expr`, which is not allowed for `ty` fragments - --> $DIR/macro-follow.rs:64:12 + --> $DIR/macro-follow.rs:84:12 | LL | ($t:ty $e:expr) => {}; | ^^^^^^^ not allowed after `ty` fragments @@ -359,7 +487,7 @@ LL | ($t:ty $e:expr) => {}; = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as` or `where` error: `$t:ty` is followed by `$r:ty`, which is not allowed for `ty` fragments - --> $DIR/macro-follow.rs:65:12 + --> $DIR/macro-follow.rs:85:12 | LL | ($t:ty $r:ty) => {}; | ^^^^^ not allowed after `ty` fragments @@ -367,7 +495,7 @@ LL | ($t:ty $r:ty) => {}; = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as` or `where` error: `$t:ty` is followed by `$s:stmt`, which is not allowed for `ty` fragments - --> $DIR/macro-follow.rs:66:12 + --> $DIR/macro-follow.rs:86:12 | LL | ($t:ty $s:stmt) => {}; | ^^^^^^^ not allowed after `ty` fragments @@ -375,7 +503,7 @@ LL | ($t:ty $s:stmt) => {}; = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as` or `where` error: `$t:ty` is followed by `$p:path`, which is not allowed for `ty` fragments - --> $DIR/macro-follow.rs:67:12 + --> $DIR/macro-follow.rs:87:12 | LL | ($t:ty $p:path) => {}; | ^^^^^^^ not allowed after `ty` fragments @@ -383,7 +511,7 @@ LL | ($t:ty $p:path) => {}; = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as` or `where` error: `$t:ty` is followed by `$i:ident`, which is not allowed for `ty` fragments - --> $DIR/macro-follow.rs:69:12 + --> $DIR/macro-follow.rs:89:12 | LL | ($t:ty $i:ident) => {}; | ^^^^^^^^ not allowed after `ty` fragments @@ -391,7 +519,7 @@ LL | ($t:ty $i:ident) => {}; = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as` or `where` error: `$t:ty` is followed by `$r:tt`, which is not allowed for `ty` fragments - --> $DIR/macro-follow.rs:70:12 + --> $DIR/macro-follow.rs:90:12 | LL | ($t:ty $r:tt) => {}; | ^^^^^ not allowed after `ty` fragments @@ -399,7 +527,7 @@ LL | ($t:ty $r:tt) => {}; = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as` or `where` error: `$t:ty` is followed by `$i:item`, which is not allowed for `ty` fragments - --> $DIR/macro-follow.rs:71:12 + --> $DIR/macro-follow.rs:91:12 | LL | ($t:ty $i:item) => {}; | ^^^^^^^ not allowed after `ty` fragments @@ -407,7 +535,7 @@ LL | ($t:ty $i:item) => {}; = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as` or `where` error: `$t:ty` is followed by `$m:meta`, which is not allowed for `ty` fragments - --> $DIR/macro-follow.rs:72:12 + --> $DIR/macro-follow.rs:92:12 | LL | ($t:ty $m:meta) => {}; | ^^^^^^^ not allowed after `ty` fragments @@ -415,7 +543,7 @@ LL | ($t:ty $m:meta) => {}; = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as` or `where` error: `$t:ty` is followed by `$g:guard`, which is not allowed for `ty` fragments - --> $DIR/macro-follow.rs:73:12 + --> $DIR/macro-follow.rs:93:12 | LL | ($t:ty $g:guard) => {}; | ^^^^^^^^ not allowed after `ty` fragments @@ -423,7 +551,7 @@ LL | ($t:ty $g:guard) => {}; = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as` or `where` error: `$s:stmt` is followed by `(`, which is not allowed for `stmt` fragments - --> $DIR/macro-follow.rs:77:14 + --> $DIR/macro-follow.rs:97:14 | LL | ($s:stmt ()) => {}; | ^ not allowed after `stmt` fragments @@ -431,7 +559,7 @@ LL | ($s:stmt ()) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$s:stmt` is followed by `[`, which is not allowed for `stmt` fragments - --> $DIR/macro-follow.rs:78:14 + --> $DIR/macro-follow.rs:98:14 | LL | ($s:stmt []) => {}; | ^ not allowed after `stmt` fragments @@ -439,7 +567,7 @@ LL | ($s:stmt []) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$s:stmt` is followed by `{`, which is not allowed for `stmt` fragments - --> $DIR/macro-follow.rs:79:14 + --> $DIR/macro-follow.rs:99:14 | LL | ($s:stmt {}) => {}; | ^ not allowed after `stmt` fragments @@ -447,7 +575,7 @@ LL | ($s:stmt {}) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$s:stmt` is followed by `=`, which is not allowed for `stmt` fragments - --> $DIR/macro-follow.rs:80:14 + --> $DIR/macro-follow.rs:100:14 | LL | ($s:stmt =) => {}; | ^ not allowed after `stmt` fragments @@ -455,7 +583,7 @@ LL | ($s:stmt =) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$s:stmt` is followed by `|`, which is not allowed for `stmt` fragments - --> $DIR/macro-follow.rs:81:14 + --> $DIR/macro-follow.rs:101:14 | LL | ($s:stmt |) => {}; | ^ not allowed after `stmt` fragments @@ -463,7 +591,7 @@ LL | ($s:stmt |) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$s:stmt` is followed by `:`, which is not allowed for `stmt` fragments - --> $DIR/macro-follow.rs:82:14 + --> $DIR/macro-follow.rs:102:14 | LL | ($s:stmt :) => {}; | ^ not allowed after `stmt` fragments @@ -471,7 +599,7 @@ LL | ($s:stmt :) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$s:stmt` is followed by `>`, which is not allowed for `stmt` fragments - --> $DIR/macro-follow.rs:83:14 + --> $DIR/macro-follow.rs:103:14 | LL | ($s:stmt >) => {}; | ^ not allowed after `stmt` fragments @@ -479,7 +607,7 @@ LL | ($s:stmt >) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$s:stmt` is followed by `+`, which is not allowed for `stmt` fragments - --> $DIR/macro-follow.rs:84:14 + --> $DIR/macro-follow.rs:104:14 | LL | ($s:stmt +) => {}; | ^ not allowed after `stmt` fragments @@ -487,7 +615,7 @@ LL | ($s:stmt +) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$s:stmt` is followed by `ident`, which is not allowed for `stmt` fragments - --> $DIR/macro-follow.rs:85:14 + --> $DIR/macro-follow.rs:105:14 | LL | ($s:stmt ident) => {}; | ^^^^^ not allowed after `stmt` fragments @@ -495,7 +623,7 @@ LL | ($s:stmt ident) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$s:stmt` is followed by `if`, which is not allowed for `stmt` fragments - --> $DIR/macro-follow.rs:86:14 + --> $DIR/macro-follow.rs:106:14 | LL | ($s:stmt if) => {}; | ^^ not allowed after `stmt` fragments @@ -503,7 +631,7 @@ LL | ($s:stmt if) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$s:stmt` is followed by `in`, which is not allowed for `stmt` fragments - --> $DIR/macro-follow.rs:87:14 + --> $DIR/macro-follow.rs:107:14 | LL | ($s:stmt in) => {}; | ^^ not allowed after `stmt` fragments @@ -511,7 +639,7 @@ LL | ($s:stmt in) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$s:stmt` is followed by `$p:pat`, which is not allowed for `stmt` fragments - --> $DIR/macro-follow.rs:88:14 + --> $DIR/macro-follow.rs:108:14 | LL | ($s:stmt $p:pat) => {}; | ^^^^^^ not allowed after `stmt` fragments @@ -519,7 +647,7 @@ LL | ($s:stmt $p:pat) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$s:stmt` is followed by `$e:expr`, which is not allowed for `stmt` fragments - --> $DIR/macro-follow.rs:89:14 + --> $DIR/macro-follow.rs:109:14 | LL | ($s:stmt $e:expr) => {}; | ^^^^^^^ not allowed after `stmt` fragments @@ -527,7 +655,7 @@ LL | ($s:stmt $e:expr) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$s:stmt` is followed by `$t:ty`, which is not allowed for `stmt` fragments - --> $DIR/macro-follow.rs:90:14 + --> $DIR/macro-follow.rs:110:14 | LL | ($s:stmt $t:ty) => {}; | ^^^^^ not allowed after `stmt` fragments @@ -535,7 +663,7 @@ LL | ($s:stmt $t:ty) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$s:stmt` is followed by `$t:stmt`, which is not allowed for `stmt` fragments - --> $DIR/macro-follow.rs:91:14 + --> $DIR/macro-follow.rs:111:14 | LL | ($s:stmt $t:stmt) => {}; | ^^^^^^^ not allowed after `stmt` fragments @@ -543,7 +671,7 @@ LL | ($s:stmt $t:stmt) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$s:stmt` is followed by `$p:path`, which is not allowed for `stmt` fragments - --> $DIR/macro-follow.rs:92:14 + --> $DIR/macro-follow.rs:112:14 | LL | ($s:stmt $p:path) => {}; | ^^^^^^^ not allowed after `stmt` fragments @@ -551,7 +679,7 @@ LL | ($s:stmt $p:path) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$s:stmt` is followed by `$b:block`, which is not allowed for `stmt` fragments - --> $DIR/macro-follow.rs:93:14 + --> $DIR/macro-follow.rs:113:14 | LL | ($s:stmt $b:block) => {}; | ^^^^^^^^ not allowed after `stmt` fragments @@ -559,7 +687,7 @@ LL | ($s:stmt $b:block) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$s:stmt` is followed by `$i:ident`, which is not allowed for `stmt` fragments - --> $DIR/macro-follow.rs:94:14 + --> $DIR/macro-follow.rs:114:14 | LL | ($s:stmt $i:ident) => {}; | ^^^^^^^^ not allowed after `stmt` fragments @@ -567,7 +695,7 @@ LL | ($s:stmt $i:ident) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$s:stmt` is followed by `$t:tt`, which is not allowed for `stmt` fragments - --> $DIR/macro-follow.rs:95:14 + --> $DIR/macro-follow.rs:115:14 | LL | ($s:stmt $t:tt) => {}; | ^^^^^ not allowed after `stmt` fragments @@ -575,7 +703,7 @@ LL | ($s:stmt $t:tt) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$s:stmt` is followed by `$i:item`, which is not allowed for `stmt` fragments - --> $DIR/macro-follow.rs:96:14 + --> $DIR/macro-follow.rs:116:14 | LL | ($s:stmt $i:item) => {}; | ^^^^^^^ not allowed after `stmt` fragments @@ -583,7 +711,7 @@ LL | ($s:stmt $i:item) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$s:stmt` is followed by `$m:meta`, which is not allowed for `stmt` fragments - --> $DIR/macro-follow.rs:97:14 + --> $DIR/macro-follow.rs:117:14 | LL | ($s:stmt $m:meta) => {}; | ^^^^^^^ not allowed after `stmt` fragments @@ -591,7 +719,7 @@ LL | ($s:stmt $m:meta) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$s:stmt` is followed by `$g:guard`, which is not allowed for `stmt` fragments - --> $DIR/macro-follow.rs:98:14 + --> $DIR/macro-follow.rs:118:14 | LL | ($s:stmt $g:guard) => {}; | ^^^^^^^^ not allowed after `stmt` fragments @@ -599,7 +727,7 @@ LL | ($s:stmt $g:guard) => {}; = note: allowed there are: `=>`, `,` or `;` error: `$p:path` is followed by `(`, which is not allowed for `path` fragments - --> $DIR/macro-follow.rs:102:14 + --> $DIR/macro-follow.rs:122:14 | LL | ($p:path ()) => {}; | ^ not allowed after `path` fragments @@ -607,7 +735,7 @@ LL | ($p:path ()) => {}; = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as` or `where` error: `$p:path` is followed by `+`, which is not allowed for `path` fragments - --> $DIR/macro-follow.rs:104:14 + --> $DIR/macro-follow.rs:124:14 | LL | ($p:path +) => {}; | ^ not allowed after `path` fragments @@ -615,7 +743,7 @@ LL | ($p:path +) => {}; = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as` or `where` error: `$p:path` is followed by `ident`, which is not allowed for `path` fragments - --> $DIR/macro-follow.rs:105:14 + --> $DIR/macro-follow.rs:125:14 | LL | ($p:path ident) => {}; | ^^^^^ not allowed after `path` fragments @@ -623,7 +751,7 @@ LL | ($p:path ident) => {}; = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as` or `where` error: `$p:path` is followed by `if`, which is not allowed for `path` fragments - --> $DIR/macro-follow.rs:106:14 + --> $DIR/macro-follow.rs:126:14 | LL | ($p:path if) => {}; | ^^ not allowed after `path` fragments @@ -631,7 +759,7 @@ LL | ($p:path if) => {}; = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as` or `where` error: `$p:path` is followed by `$q:pat`, which is not allowed for `path` fragments - --> $DIR/macro-follow.rs:107:14 + --> $DIR/macro-follow.rs:127:14 | LL | ($p:path $q:pat) => {}; | ^^^^^^ not allowed after `path` fragments @@ -639,7 +767,7 @@ LL | ($p:path $q:pat) => {}; = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as` or `where` error: `$p:path` is followed by `$e:expr`, which is not allowed for `path` fragments - --> $DIR/macro-follow.rs:108:14 + --> $DIR/macro-follow.rs:128:14 | LL | ($p:path $e:expr) => {}; | ^^^^^^^ not allowed after `path` fragments @@ -647,7 +775,7 @@ LL | ($p:path $e:expr) => {}; = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as` or `where` error: `$p:path` is followed by `$t:ty`, which is not allowed for `path` fragments - --> $DIR/macro-follow.rs:109:14 + --> $DIR/macro-follow.rs:129:14 | LL | ($p:path $t:ty) => {}; | ^^^^^ not allowed after `path` fragments @@ -655,7 +783,7 @@ LL | ($p:path $t:ty) => {}; = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as` or `where` error: `$p:path` is followed by `$s:stmt`, which is not allowed for `path` fragments - --> $DIR/macro-follow.rs:110:14 + --> $DIR/macro-follow.rs:130:14 | LL | ($p:path $s:stmt) => {}; | ^^^^^^^ not allowed after `path` fragments @@ -663,7 +791,7 @@ LL | ($p:path $s:stmt) => {}; = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as` or `where` error: `$p:path` is followed by `$q:path`, which is not allowed for `path` fragments - --> $DIR/macro-follow.rs:111:14 + --> $DIR/macro-follow.rs:131:14 | LL | ($p:path $q:path) => {}; | ^^^^^^^ not allowed after `path` fragments @@ -671,7 +799,7 @@ LL | ($p:path $q:path) => {}; = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as` or `where` error: `$p:path` is followed by `$i:ident`, which is not allowed for `path` fragments - --> $DIR/macro-follow.rs:113:14 + --> $DIR/macro-follow.rs:133:14 | LL | ($p:path $i:ident) => {}; | ^^^^^^^^ not allowed after `path` fragments @@ -679,7 +807,7 @@ LL | ($p:path $i:ident) => {}; = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as` or `where` error: `$p:path` is followed by `$t:tt`, which is not allowed for `path` fragments - --> $DIR/macro-follow.rs:114:14 + --> $DIR/macro-follow.rs:134:14 | LL | ($p:path $t:tt) => {}; | ^^^^^ not allowed after `path` fragments @@ -687,7 +815,7 @@ LL | ($p:path $t:tt) => {}; = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as` or `where` error: `$p:path` is followed by `$i:item`, which is not allowed for `path` fragments - --> $DIR/macro-follow.rs:115:14 + --> $DIR/macro-follow.rs:135:14 | LL | ($p:path $i:item) => {}; | ^^^^^^^ not allowed after `path` fragments @@ -695,7 +823,7 @@ LL | ($p:path $i:item) => {}; = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as` or `where` error: `$p:path` is followed by `$m:meta`, which is not allowed for `path` fragments - --> $DIR/macro-follow.rs:116:14 + --> $DIR/macro-follow.rs:136:14 | LL | ($p:path $m:meta) => {}; | ^^^^^^^ not allowed after `path` fragments @@ -703,12 +831,12 @@ LL | ($p:path $m:meta) => {}; = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as` or `where` error: `$p:path` is followed by `$g:guard`, which is not allowed for `path` fragments - --> $DIR/macro-follow.rs:117:14 + --> $DIR/macro-follow.rs:137:14 | LL | ($p:path $g:guard) => {}; | ^^^^^^^^ not allowed after `path` fragments | = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as` or `where` -error: aborting due to 89 previous errors +error: aborting due to 105 previous errors