@@ -16,182 +16,194 @@ error: unexpected token: $
16
16
LL | ( $$ $a:ident ) => {
17
17
| ^
18
18
19
- note: `$$` and meta-variable expressions are not allowed inside macro parameter definitions
19
+ note: `$$`, `$crate`, and meta-variable expressions are not allowed inside macro parameter definitions
20
20
--> $DIR/syntax-errors.rs:53:8
21
21
|
22
22
LL | ( $$ $a:ident ) => {
23
23
| ^
24
24
25
+ error: unexpected token: crate
26
+ --> $DIR/syntax-errors.rs:59:8
27
+ |
28
+ LL | ( $crate $a:ident ) => {
29
+ | ^^^^^
30
+
31
+ note: `$$`, `$crate`, and meta-variable expressions are not allowed inside macro parameter definitions
32
+ --> $DIR/syntax-errors.rs:59:8
33
+ |
34
+ LL | ( $crate $a:ident ) => {
35
+ | ^^^^^
36
+
25
37
error: unexpected token: a
26
- --> $DIR/syntax-errors.rs:60 :19
38
+ --> $DIR/syntax-errors.rs:66 :19
27
39
|
28
40
LL | ${count() a b c}
29
41
| ^
30
42
|
31
43
note: meta-variable expression must not have trailing tokens
32
- --> $DIR/syntax-errors.rs:60 :19
44
+ --> $DIR/syntax-errors.rs:66 :19
33
45
|
34
46
LL | ${count() a b c}
35
47
| ^
36
48
37
49
error: unexpected token: a
38
- --> $DIR/syntax-errors.rs:63 :19
50
+ --> $DIR/syntax-errors.rs:69 :19
39
51
|
40
52
LL | ${count(i a b c)}
41
53
| ^
42
54
|
43
55
note: meta-variable expression must not have trailing tokens
44
- --> $DIR/syntax-errors.rs:63 :19
56
+ --> $DIR/syntax-errors.rs:69 :19
45
57
|
46
58
LL | ${count(i a b c)}
47
59
| ^
48
60
49
61
error: unexpected token: a
50
- --> $DIR/syntax-errors.rs:65 :22
62
+ --> $DIR/syntax-errors.rs:71 :22
51
63
|
52
64
LL | ${count(i, 1 a b c)}
53
65
| ^
54
66
|
55
67
note: meta-variable expression must not have trailing tokens
56
- --> $DIR/syntax-errors.rs:65 :22
68
+ --> $DIR/syntax-errors.rs:71 :22
57
69
|
58
70
LL | ${count(i, 1 a b c)}
59
71
| ^
60
72
61
73
error: unexpected token: a
62
- --> $DIR/syntax-errors.rs:67 :20
74
+ --> $DIR/syntax-errors.rs:73 :20
63
75
|
64
76
LL | ${count(i) a b c}
65
77
| ^
66
78
|
67
79
note: meta-variable expression must not have trailing tokens
68
- --> $DIR/syntax-errors.rs:67 :20
80
+ --> $DIR/syntax-errors.rs:73 :20
69
81
|
70
82
LL | ${count(i) a b c}
71
83
| ^
72
84
73
85
error: unexpected token: a
74
- --> $DIR/syntax-errors.rs:70 :21
86
+ --> $DIR/syntax-errors.rs:76 :21
75
87
|
76
88
LL | ${ignore(i) a b c}
77
89
| ^
78
90
|
79
91
note: meta-variable expression must not have trailing tokens
80
- --> $DIR/syntax-errors.rs:70 :21
92
+ --> $DIR/syntax-errors.rs:76 :21
81
93
|
82
94
LL | ${ignore(i) a b c}
83
95
| ^
84
96
85
97
error: unexpected token: a
86
- --> $DIR/syntax-errors.rs:72 :20
98
+ --> $DIR/syntax-errors.rs:78 :20
87
99
|
88
100
LL | ${ignore(i a b c)}
89
101
| ^
90
102
|
91
103
note: meta-variable expression must not have trailing tokens
92
- --> $DIR/syntax-errors.rs:72 :20
104
+ --> $DIR/syntax-errors.rs:78 :20
93
105
|
94
106
LL | ${ignore(i a b c)}
95
107
| ^
96
108
97
109
error: unexpected token: a
98
- --> $DIR/syntax-errors.rs:75 :19
110
+ --> $DIR/syntax-errors.rs:81 :19
99
111
|
100
112
LL | ${index() a b c}
101
113
| ^
102
114
|
103
115
note: meta-variable expression must not have trailing tokens
104
- --> $DIR/syntax-errors.rs:75 :19
116
+ --> $DIR/syntax-errors.rs:81 :19
105
117
|
106
118
LL | ${index() a b c}
107
119
| ^
108
120
109
121
error: unexpected token: a
110
- --> $DIR/syntax-errors.rs:77 :19
122
+ --> $DIR/syntax-errors.rs:83 :19
111
123
|
112
124
LL | ${index(1 a b c)}
113
125
| ^
114
126
|
115
127
note: meta-variable expression must not have trailing tokens
116
- --> $DIR/syntax-errors.rs:77 :19
128
+ --> $DIR/syntax-errors.rs:83 :19
117
129
|
118
130
LL | ${index(1 a b c)}
119
131
| ^
120
132
121
133
error: unexpected token: a
122
- --> $DIR/syntax-errors.rs:80 :19
134
+ --> $DIR/syntax-errors.rs:86 :19
123
135
|
124
136
LL | ${index() a b c}
125
137
| ^
126
138
|
127
139
note: meta-variable expression must not have trailing tokens
128
- --> $DIR/syntax-errors.rs:80 :19
140
+ --> $DIR/syntax-errors.rs:86 :19
129
141
|
130
142
LL | ${index() a b c}
131
143
| ^
132
144
133
145
error: unexpected token: a
134
- --> $DIR/syntax-errors.rs:82 :19
146
+ --> $DIR/syntax-errors.rs:88 :19
135
147
|
136
148
LL | ${index(1 a b c)}
137
149
| ^
138
150
|
139
151
note: meta-variable expression must not have trailing tokens
140
- --> $DIR/syntax-errors.rs:82 :19
152
+ --> $DIR/syntax-errors.rs:88 :19
141
153
|
142
154
LL | ${index(1 a b c)}
143
155
| ^
144
156
145
157
error: meta-variable expression depth must be a literal
146
- --> $DIR/syntax-errors.rs:89 :33
158
+ --> $DIR/syntax-errors.rs:95 :33
147
159
|
148
160
LL | ( $( $i:ident ),* ) => { ${ index(IDX) } };
149
161
| ^^^^^
150
162
151
163
error: unexpected token: {
152
- --> $DIR/syntax-errors.rs:95 :8
164
+ --> $DIR/syntax-errors.rs:101 :8
153
165
|
154
166
LL | ( ${ length() } ) => {
155
167
| ^^^^^^^^^^^^
156
168
157
- note: `$$` and meta-variable expressions are not allowed inside macro parameter definitions
158
- --> $DIR/syntax-errors.rs:95 :8
169
+ note: `$$`, `$crate`, and meta-variable expressions are not allowed inside macro parameter definitions
170
+ --> $DIR/syntax-errors.rs:101 :8
159
171
|
160
172
LL | ( ${ length() } ) => {
161
173
| ^^^^^^^^^^^^
162
174
163
175
error: expected one of: `*`, `+`, or `?`
164
- --> $DIR/syntax-errors.rs:95 :8
176
+ --> $DIR/syntax-errors.rs:101 :8
165
177
|
166
178
LL | ( ${ length() } ) => {
167
179
| ^^^^^^^^^^^^
168
180
169
181
error: expected identifier
170
- --> $DIR/syntax-errors.rs:102 :33
182
+ --> $DIR/syntax-errors.rs:108 :33
171
183
|
172
184
LL | ( $( $i:ident ),* ) => { ${ ignore() } };
173
185
| ^^^^^^
174
186
175
187
error: only unsuffixes integer literals are supported in meta-variable expressions
176
- --> $DIR/syntax-errors.rs:108 :33
188
+ --> $DIR/syntax-errors.rs:114 :33
177
189
|
178
190
LL | ( $( $i:ident ),* ) => { ${ index(1u32) } };
179
191
| ^^^^^
180
192
181
193
error: meta-variable expression parameter must be wrapped in parentheses
182
- --> $DIR/syntax-errors.rs:114 :33
194
+ --> $DIR/syntax-errors.rs:120 :33
183
195
|
184
196
LL | ( $( $i:ident ),* ) => { ${ count{i} } };
185
197
| ^^^^^
186
198
187
199
error: expected identifier
188
- --> $DIR/syntax-errors.rs:120 :31
200
+ --> $DIR/syntax-errors.rs:126 :31
189
201
|
190
202
LL | ( $( $i:ident ),* ) => { ${ {} } };
191
203
| ^^^^^^
192
204
193
205
error: unrecognized meta-variable expression
194
- --> $DIR/syntax-errors.rs:140 :33
206
+ --> $DIR/syntax-errors.rs:146 :33
195
207
|
196
208
LL | ( $( $i:ident ),* ) => { ${ aaaaaaaaaaaaaa(i) } };
197
209
| ^^^^^^^^^^^^^^ help: supported expressions are count, ignore, index and length
@@ -231,7 +243,7 @@ LL | ( $( $i:ident ),* ) => { count($i) };
231
243
| ^^
232
244
233
245
error: expected expression, found `$`
234
- --> $DIR/syntax-errors.rs:60 :9
246
+ --> $DIR/syntax-errors.rs:66 :9
235
247
|
236
248
LL | ${count() a b c}
237
249
| ^ expected expression
@@ -242,7 +254,7 @@ LL | extra_garbage_after_metavar!(a);
242
254
= note: this error originates in the macro `extra_garbage_after_metavar` (in Nightly builds, run with -Z macro-backtrace for more info)
243
255
244
256
error: expected expression, found `$`
245
- --> $DIR/syntax-errors.rs:89 :30
257
+ --> $DIR/syntax-errors.rs:95 :30
246
258
|
247
259
LL | ( $( $i:ident ),* ) => { ${ index(IDX) } };
248
260
| ^ expected expression
@@ -253,7 +265,7 @@ LL | metavar_depth_is_not_literal!(a);
253
265
= note: this error originates in the macro `metavar_depth_is_not_literal` (in Nightly builds, run with -Z macro-backtrace for more info)
254
266
255
267
error: expected expression, found `$`
256
- --> $DIR/syntax-errors.rs:102 :30
268
+ --> $DIR/syntax-errors.rs:108 :30
257
269
|
258
270
LL | ( $( $i:ident ),* ) => { ${ ignore() } };
259
271
| ^ expected expression
@@ -264,7 +276,7 @@ LL | metavar_token_without_ident!(a);
264
276
= note: this error originates in the macro `metavar_token_without_ident` (in Nightly builds, run with -Z macro-backtrace for more info)
265
277
266
278
error: expected expression, found `$`
267
- --> $DIR/syntax-errors.rs:108 :30
279
+ --> $DIR/syntax-errors.rs:114 :30
268
280
|
269
281
LL | ( $( $i:ident ),* ) => { ${ index(1u32) } };
270
282
| ^ expected expression
@@ -275,7 +287,7 @@ LL | metavar_with_literal_suffix!(a);
275
287
= note: this error originates in the macro `metavar_with_literal_suffix` (in Nightly builds, run with -Z macro-backtrace for more info)
276
288
277
289
error: expected expression, found `$`
278
- --> $DIR/syntax-errors.rs:114 :30
290
+ --> $DIR/syntax-errors.rs:120 :30
279
291
|
280
292
LL | ( $( $i:ident ),* ) => { ${ count{i} } };
281
293
| ^ expected expression
@@ -286,7 +298,7 @@ LL | metavar_without_parens!(a);
286
298
= note: this error originates in the macro `metavar_without_parens` (in Nightly builds, run with -Z macro-backtrace for more info)
287
299
288
300
error: expected expression, found `$`
289
- --> $DIR/syntax-errors.rs:120 :30
301
+ --> $DIR/syntax-errors.rs:126 :30
290
302
|
291
303
LL | ( $( $i:ident ),* ) => { ${ {} } };
292
304
| ^ expected expression
@@ -297,19 +309,19 @@ LL | open_brackets_without_tokens!(a);
297
309
= note: this error originates in the macro `open_brackets_without_tokens` (in Nightly builds, run with -Z macro-backtrace for more info)
298
310
299
311
error: variable `foo` is not recognized in meta-variable expression
300
- --> $DIR/syntax-errors.rs:127 :17
312
+ --> $DIR/syntax-errors.rs:133 :17
301
313
|
302
314
LL | ${count(foo)}
303
315
| ^^^
304
316
305
317
error: variable `bar` is not recognized in meta-variable expression
306
- --> $DIR/syntax-errors.rs:134 :18
318
+ --> $DIR/syntax-errors.rs:140 :18
307
319
|
308
320
LL | ${ignore(bar)}
309
321
| ^^^
310
322
311
323
error: expected expression, found `$`
312
- --> $DIR/syntax-errors.rs:140 :30
324
+ --> $DIR/syntax-errors.rs:146 :30
313
325
|
314
326
LL | ( $( $i:ident ),* ) => { ${ aaaaaaaaaaaaaa(i) } };
315
327
| ^ expected expression
@@ -375,11 +387,11 @@ LL | no_curly__rhs_dollar__no_round!(a);
375
387
= note: this error originates in the macro `no_curly__rhs_dollar__no_round` (in Nightly builds, run with -Z macro-backtrace for more info)
376
388
377
389
error[E0425]: cannot find value `a` in this scope
378
- --> $DIR/syntax-errors.rs:153 :37
390
+ --> $DIR/syntax-errors.rs:159 :37
379
391
|
380
392
LL | no_curly__rhs_dollar__no_round!(a);
381
393
| ^ not found in this scope
382
394
383
- error: aborting due to 40 previous errors
395
+ error: aborting due to 41 previous errors
384
396
385
397
For more information about this error, try `rustc --explain E0425`.
0 commit comments