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
42 lines
1 KiB
Text
42 lines
1 KiB
Text
error: expected identifier, found `+`
|
|
--> $DIR/issue-33569.rs:2:8
|
|
|
|
|
LL | { $+ } => {
|
|
| ^
|
|
|
|
error: missing fragment specifier
|
|
--> $DIR/issue-33569.rs:2:8
|
|
|
|
|
LL | { $+ } => {
|
|
| ^
|
|
|
|
|
= 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 | { $+:spec } => {
|
|
| +++++
|
|
|
|
error: expected one of: `*`, `+`, or `?`
|
|
--> $DIR/issue-33569.rs:4:13
|
|
|
|
|
LL | $(x)(y)
|
|
| ^^^
|
|
|
|
error: unexpected end of macro invocation
|
|
--> $DIR/issue-33569.rs:8:1
|
|
|
|
|
LL | macro_rules! foo {
|
|
| ---------------- when calling this macro
|
|
...
|
|
LL | foo!();
|
|
| ^^^^^^ missing tokens in macro arguments
|
|
|
|
|
note: while trying to match meta-variable `$<!dummy!>:tt`
|
|
--> $DIR/issue-33569.rs:2:8
|
|
|
|
|
LL | { $+ } => {
|
|
| ^
|
|
|
|
error: aborting due to 4 previous errors
|
|
|