You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rollup merge of rust-lang#126928 - nnethercote:124141-pre, r=oli-obk
Some `Nonterminal` removal precursors
Small things to prepare for rust-lang#124141, more or less.
r? ```@oli-obk```
Copy file name to clipboardexpand all lines: tests/ui/macros/nonterminal-matching.stderr
+89-1
Original file line number
Diff line number
Diff line change
@@ -23,5 +23,93 @@ LL | complex_nonterminal!(enum E {});
23
23
= help: try using `:tt` instead in the macro definition
24
24
= note: this error originates in the macro `complex_nonterminal` (in Nightly builds, run with -Z macro-backtrace for more info)
25
25
26
-
error: aborting due to 1 previous error
26
+
error: no rules expected the token `3`
27
+
--> $DIR/nonterminal-matching.rs:32:35
28
+
|
29
+
LL | (expr $x:expr) => { bar!(expr $x); };
30
+
| ^^ no rules expected this token in macro call
31
+
...
32
+
LL | macro_rules! bar {
33
+
| ---------------- when calling this macro
34
+
...
35
+
LL | foo!(expr 3);
36
+
| ------------ in this macro invocation
37
+
|
38
+
note: while trying to match `3`
39
+
--> $DIR/nonterminal-matching.rs:42:11
40
+
|
41
+
LL | (expr 3) => {};
42
+
| ^
43
+
= note: captured metavariables except for `:tt`, `:ident` and `:lifetime` cannot be compared to other tokens
44
+
= note: see <https://doc.rust-lang.org/nightly/reference/macros-by-example.html#forwarding-a-matched-fragment> for more information
45
+
= help: try using `:tt` instead in the macro definition
46
+
= note: this error originates in the macro `foo` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: captured metavariables except for `:tt`, `:ident` and `:lifetime` cannot be compared to other tokens
66
+
= note: see <https://doc.rust-lang.org/nightly/reference/macros-by-example.html#forwarding-a-matched-fragment> for more information
67
+
= help: try using `:tt` instead in the macro definition
68
+
= note: this error originates in the macro `foo` (in Nightly builds, run with -Z macro-backtrace for more info)
69
+
70
+
error: no rules expected the token `a::b::c`
71
+
--> $DIR/nonterminal-matching.rs:34:35
72
+
|
73
+
LL | (path $x:path) => { bar!(path $x); };
74
+
| ^^ no rules expected this token in macro call
75
+
...
76
+
LL | macro_rules! bar {
77
+
| ---------------- when calling this macro
78
+
...
79
+
LL | foo!(path a::b::c);
80
+
| ------------------ in this macro invocation
81
+
|
82
+
note: while trying to match `a`
83
+
--> $DIR/nonterminal-matching.rs:44:11
84
+
|
85
+
LL | (path a::b::c) => {};
86
+
| ^
87
+
= note: captured metavariables except for `:tt`, `:ident` and `:lifetime` cannot be compared to other tokens
88
+
= note: see <https://doc.rust-lang.org/nightly/reference/macros-by-example.html#forwarding-a-matched-fragment> for more information
89
+
= help: try using `:tt` instead in the macro definition
90
+
= note: this error originates in the macro `foo` (in Nightly builds, run with -Z macro-backtrace for more info)
91
+
92
+
error: no rules expected the token `let abc = 0`
93
+
--> $DIR/nonterminal-matching.rs:35:35
94
+
|
95
+
LL | (stmt $x:stmt) => { bar!(stmt $x); };
96
+
| ^^ no rules expected this token in macro call
97
+
...
98
+
LL | macro_rules! bar {
99
+
| ---------------- when calling this macro
100
+
...
101
+
LL | foo!(stmt let abc = 0);
102
+
| ---------------------- in this macro invocation
103
+
|
104
+
note: while trying to match `let`
105
+
--> $DIR/nonterminal-matching.rs:45:11
106
+
|
107
+
LL | (stmt let abc = 0) => {};
108
+
| ^^^
109
+
= note: captured metavariables except for `:tt`, `:ident` and `:lifetime` cannot be compared to other tokens
110
+
= note: see <https://doc.rust-lang.org/nightly/reference/macros-by-example.html#forwarding-a-matched-fragment> for more information
111
+
= help: try using `:tt` instead in the macro definition
112
+
= note: this error originates in the macro `foo` (in Nightly builds, run with -Z macro-backtrace for more info)
0 commit comments