about summary refs log tree commit diff
path: root/tests/ui/macros/metavar-expressions/syntax-errors.stderr
blob: bf1c7673a6ce128f1deb607a2409e772293f0600 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
error: unexpected token: $
  --> $DIR/syntax-errors.rs:9:8
   |
LL |     ( $$ $a:ident ) => {
   |        ^

note: `$$` and meta-variable expressions are not allowed inside macro parameter definitions
  --> $DIR/syntax-errors.rs:9:8
   |
LL |     ( $$ $a:ident ) => {
   |        ^

error: unexpected token: {
  --> $DIR/syntax-errors.rs:15:8
   |
LL |     ( ${ len() } ) => {
   |        ^^^^^^^^^

note: `$$` and meta-variable expressions are not allowed inside macro parameter definitions
  --> $DIR/syntax-errors.rs:15:8
   |
LL |     ( ${ len() } ) => {
   |        ^^^^^^^^^

error: expected one of: `*`, `+`, or `?`
  --> $DIR/syntax-errors.rs:15:8
   |
LL |     ( ${ len() } ) => {
   |        ^^^^^^^^^

error: meta-variables within meta-variable expressions must be referenced using a dollar sign
  --> $DIR/syntax-errors.rs:22:33
   |
LL |     ( $( $i:ident ),* ) => { ${ ignore() } };
   |                                 ^^^^^^

error: only unsuffixes integer literals are supported in meta-variable expressions
  --> $DIR/syntax-errors.rs:27:33
   |
LL |     ( $( $i:ident ),* ) => { ${ index(1u32) } };
   |                                 ^^^^^

error: expected `(`
  --> $DIR/syntax-errors.rs:32:33
   |
LL |     ( $( $i:ident ),* ) => { ${ count } };
   |                                 ^^^^^- help: try adding parentheses: `( /* ... */ )`
   |                                 |
   |                                 for this this metavariable expression
   |
   = note: metavariable expressions use function-like parentheses syntax

error: expected `(`
  --> $DIR/syntax-errors.rs:49:33
   |
LL |     ( $( $i:ident ),* ) => { ${ count $i ($i) } };
   |                                 ^^^^^ - unexpected token
   |                                 |
   |                                 for this this metavariable expression
   |
   = note: metavariable expressions use function-like parentheses syntax

error: expected `(`
  --> $DIR/syntax-errors.rs:54:33
   |
LL |     ( $( $i:ident ),* ) => { ${ count{i} } };
   |                                 ^^^^^ for this this metavariable expression
   |
   = note: metavariable expressions use function-like parentheses syntax

error: expected identifier, found `123`
  --> $DIR/syntax-errors.rs:59:23
   |
LL |     () => { ${ignore($123)} }
   |                       ^^^ help: try removing `123`

error: unexpected trailing tokens
  --> $DIR/syntax-errors.rs:71:19
   |
LL |         ${count() a b c}
   |           -----   ^^^^^ help: try removing these tokens
   |           |
   |           for this metavariable expression

error: unexpected trailing tokens
  --> $DIR/syntax-errors.rs:73:20
   |
LL |         ${count($i a b c)}
   |           -----    ^^^^^ help: try removing these tokens
   |           |
   |           for this metavariable expression
   |
   = note: the `count` metavariable expression takes between 1 and 2 arguments

error: unexpected trailing tokens
  --> $DIR/syntax-errors.rs:75:23
   |
LL |         ${count($i, 1 a b c)}
   |           -----       ^^^^^ help: try removing these tokens
   |           |
   |           for this metavariable expression
   |
   = note: the `count` metavariable expression takes between 1 and 2 arguments

error: unexpected trailing tokens
  --> $DIR/syntax-errors.rs:77:21
   |
LL |         ${count($i) a b c}
   |           -----     ^^^^^ help: try removing these tokens
   |           |
   |           for this metavariable expression

error: unexpected trailing tokens
  --> $DIR/syntax-errors.rs:80:22
   |
LL |         ${ignore($i) a b c}
   |           ------     ^^^^^ help: try removing these tokens
   |           |
   |           for this metavariable expression

error: unexpected trailing tokens
  --> $DIR/syntax-errors.rs:82:21
   |
LL |         ${ignore($i a b c)}
   |           ------    ^^^^^ help: try removing these tokens
   |           |
   |           for this metavariable expression
   |
   = note: the `ignore` metavariable expression takes a single argument

error: unexpected trailing tokens
  --> $DIR/syntax-errors.rs:85:19
   |
LL |         ${index() a b c}
   |           -----   ^^^^^ help: try removing these tokens
   |           |
   |           for this metavariable expression

error: unexpected trailing tokens
  --> $DIR/syntax-errors.rs:87:19
   |
LL |         ${index(1 a b c)}
   |           -----   ^^^^^ help: try removing these tokens
   |           |
   |           for this metavariable expression
   |
   = note: the `index` metavariable expression takes between 0 and 1 arguments

error: unexpected trailing tokens
  --> $DIR/syntax-errors.rs:90:19
   |
LL |         ${index() a b c}
   |           -----   ^^^^^ help: try removing these tokens
   |           |
   |           for this metavariable expression

error: unexpected trailing tokens
  --> $DIR/syntax-errors.rs:92:19
   |
LL |         ${index(1 a b c)}
   |           -----   ^^^^^ help: try removing these tokens
   |           |
   |           for this metavariable expression
   |
   = note: the `index` metavariable expression takes between 0 and 1 arguments

error: unexpected trailing tokens
  --> $DIR/syntax-errors.rs:94:18
   |
LL |         ${index(1, a b c)}
   |           -----  ^^^^^^^ help: try removing these tokens
   |           |
   |           for this metavariable expression
   |
   = note: the `index` metavariable expression takes between 0 and 1 arguments

error: meta-variable expression depth must be a literal
  --> $DIR/syntax-errors.rs:101:33
   |
LL |     ( $( $i:ident ),* ) => { ${ index(IDX) } };
   |                                 ^^^^^

error: meta-variables within meta-variable expressions must be referenced using a dollar sign
  --> $DIR/syntax-errors.rs:107:11
   |
LL |         ${count(foo)}
   |           ^^^^^

error: meta-variables within meta-variable expressions must be referenced using a dollar sign
  --> $DIR/syntax-errors.rs:114:11
   |
LL |         ${ignore(bar)}
   |           ^^^^^^

error: unrecognized metavariable expression
  --> $DIR/syntax-errors.rs:120:33
   |
LL |     ( $( $i:ident ),* ) => { ${ aaaaaaaaaaaaaa(i) } };
   |                                 ^^^^^^^^^^^^^^ not a valid metavariable expression
   |
   = note: valid metavariable expressions are `count`, `ignore`, `index`, `len`, and `concat`

error: expected identifier or string literal
  --> $DIR/syntax-errors.rs:38:14
   |
LL |     () => { ${} };
   |              ^^

error: expected identifier, found `"hi"`
  --> $DIR/syntax-errors.rs:44:17
   |
LL |      () => { ${ "hi" } };
   |                 ^^^^ help: try removing `"hi"`

error: expected identifier or string literal
  --> $DIR/syntax-errors.rs:65:33
   |
LL |     ( $( $i:ident ),* ) => { ${ {} } };
   |                                 ^^

error: aborting due to 27 previous errors