mirror of
https://github.com/rust-lang/rust.git
synced 2025-09-28 05:34:45 +00:00

Since [1], the fragment specifier is unconditionally required in all editions. This means `NonTerminalKind` no longer needs to be optional, as we can reject this code during the expansion of `macro_rules!` rather than handling it throughout the code. Do this cleanup here. [1]: https://github.com/rust-lang/rust/pull/128425
44 lines
1.3 KiB
Plaintext
44 lines
1.3 KiB
Plaintext
error: missing fragment specifier
|
|
--> $DIR/macro-match-nonterminal.rs:2:6
|
|
|
|
|
LL | ($a, $b) => {
|
|
| ^^
|
|
|
|
|
= note: fragment specifiers must be provided
|
|
= help: valid fragment specifiers are `ident`, `block`, `stmt`, `expr`, `pat`, `ty`, `lifetime`, `literal`, `path`, `meta`, `tt`, `item` and `vis`, along with `expr_2021` and `pat_param` for edition compatibility
|
|
help: try adding a specifier here
|
|
|
|
|
LL | ($a:spec, $b) => {
|
|
| +++++
|
|
|
|
error: missing fragment specifier
|
|
--> $DIR/macro-match-nonterminal.rs:2:10
|
|
|
|
|
LL | ($a, $b) => {
|
|
| ^^
|
|
|
|
|
= note: fragment specifiers must be provided
|
|
= help: valid fragment specifiers are `ident`, `block`, `stmt`, `expr`, `pat`, `ty`, `lifetime`, `literal`, `path`, `meta`, `tt`, `item` and `vis`, along with `expr_2021` and `pat_param` for edition compatibility
|
|
help: try adding a specifier here
|
|
|
|
|
LL | ($a, $b:spec) => {
|
|
| +++++
|
|
|
|
error: unexpected end of macro invocation
|
|
--> $DIR/macro-match-nonterminal.rs:10:5
|
|
|
|
|
LL | macro_rules! test {
|
|
| ----------------- when calling this macro
|
|
...
|
|
LL | test!()
|
|
| ^^^^^^^ missing tokens in macro arguments
|
|
|
|
|
note: while trying to match meta-variable `$a:tt`
|
|
--> $DIR/macro-match-nonterminal.rs:2:6
|
|
|
|
|
LL | ($a, $b) => {
|
|
| ^^
|
|
|
|
error: aborting due to 3 previous errors
|
|
|