forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit 93e9dac
authored
Rollup merge of rust-lang#107478 - compiler-errors:anon-enum-tys-are-ambiguous, r=estebank
Revert "Teach parser to understand fake anonymous enum syntax" and related commits
anonymous enum types are currently ambiguous in positions like:
* `|` operator: `a as fn() -> B | C`
* closure args: `|_: as fn() -> A | B`
I first tried to thread around `RecoverAnonEnum` into all these positions, but the resulting complexity in the compiler is IMO not worth it, or at least worth a bit more thinking time. In the mean time, let's revert this syntax for now, so we can go back to the drawing board.
Fixes rust-lang#107461
cc: `@estebank` `@cjgillot` rust-lang#106960
---
### Squashed revert commits:
Revert "review comment: Remove AST AnonTy"
This reverts commit 020cca8.
Revert "Ensure macros are not affected"
This reverts commit 12d18e4.
Revert "Emit fewer errors on patterns with possible type ascription"
This reverts commit c847a01.
Revert "Teach parser to understand fake anonymous enum syntax"
This reverts commit 2d82420.File tree
10 files changed
+72
-265
lines changed- compiler
- rustc_ast/src
- rustc_parse/src/parser
- tests/ui/parser
- issues
10 files changed
+72
-265
lines changedOriginal file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
403 | 403 |
| |
404 | 404 |
| |
405 | 405 |
| |
406 | - | ||
407 | - | ||
406 | + | ||
407 | + | ||
408 | 408 |
| |
409 | 409 |
| |
410 | 410 |
| |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2394 | 2394 |
| |
2395 | 2395 |
| |
2396 | 2396 |
| |
2397 | - | ||
2397 | + | ||
2398 | 2398 |
| |
2399 | 2399 |
| |
2400 | 2400 |
| |
| |||
2405 | 2405 |
| |
2406 | 2406 |
| |
2407 | 2407 |
| |
2408 | - | ||
2409 | - | ||
2410 | - | ||
2411 | - | ||
2412 | - | ||
2413 | - | ||
2414 | - | ||
2415 | - | ||
2416 | - | ||
2417 | - | ||
2418 | - | ||
2419 | - | ||
2420 | - | ||
2421 | - | ||
2422 | - | ||
2423 | - | ||
2424 | - | ||
2425 | 2408 |
| |
2426 | 2409 |
| |
2427 | 2410 |
| |
2428 | 2411 |
| |
2429 | - | ||
2412 | + | ||
2430 | 2413 |
| |
2431 | 2414 |
| |
2432 | - | ||
2433 | - | ||
2415 | + | ||
2434 | 2416 |
| |
2435 | 2417 |
| |
2436 | 2418 |
| |
2437 | 2419 |
| |
2438 | - | ||
2439 | - | ||
2440 | - | ||
2420 | + | ||
2421 | + | ||
2441 | 2422 |
| |
2423 | + | ||
2424 | + | ||
2442 | 2425 |
| |
2426 | + | ||
2427 | + | ||
2443 | 2428 |
| |
2444 | 2429 |
| |
2445 | 2430 |
| |
| |||
2503 | 2488 |
| |
2504 | 2489 |
| |
2505 | 2490 |
| |
2506 | - | ||
2507 | - | ||
2491 | + | ||
2492 | + | ||
2508 | 2493 |
| |
2509 | 2494 |
| |
2510 | 2495 |
| |
2511 | 2496 |
| |
2512 | 2497 |
| |
2513 | 2498 |
| |
2514 | 2499 |
| |
2515 | - | ||
2500 | + | ||
2516 | 2501 |
| |
2517 | 2502 |
| |
2518 | - | ||
2519 | - | ||
2520 | - | ||
2521 | - | ||
2522 | - | ||
2523 | - | ||
2524 | - | ||
2525 | - | ||
2526 | - | ||
2527 | - | ||
2528 | - | ||
2529 | - | ||
2530 | 2503 |
| |
2531 | 2504 |
| |
2532 | 2505 |
| |
2506 | + | ||
2533 | 2507 |
| |
2534 | 2508 |
| |
2535 | 2509 |
| |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
118 | 118 |
| |
119 | 119 |
| |
120 | 120 |
| |
121 | - | ||
122 | - | ||
121 | + | ||
123 | 122 |
| |
124 | 123 |
| |
125 | 124 |
| |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
11 | 11 |
| |
12 | 12 |
| |
13 | 13 |
| |
14 | - | ||
15 | 14 |
| |
16 | 15 |
| |
17 | 16 |
| |
| |||
44 | 43 |
| |
45 | 44 |
| |
46 | 45 |
| |
47 | - | ||
46 | + | ||
48 | 47 |
| |
49 | 48 |
| |
50 | 49 |
| |
51 | 50 |
| |
52 | 51 |
| |
53 | - | ||
54 | 52 |
| |
55 | 53 |
| |
56 | 54 |
| |
57 | 55 |
| |
58 | 56 |
| |
59 | - | ||
60 | - | ||
61 | - | ||
62 | - | ||
63 | - | ||
64 | - | ||
65 | 57 |
| |
66 | 58 |
| |
67 | 59 |
| |
| |||
94 | 86 |
| |
95 | 87 |
| |
96 | 88 |
| |
97 | - | ||
89 | + | ||
98 | 90 |
| |
99 | 91 |
| |
100 | 92 |
| |
| |||
119 | 111 |
| |
120 | 112 |
| |
121 | 113 |
| |
122 | - | ||
123 | 114 |
| |
124 | 115 |
| |
125 | 116 |
| |
| |||
134 | 125 |
| |
135 | 126 |
| |
136 | 127 |
| |
137 | - | ||
138 | 128 |
| |
139 | 129 |
| |
140 | 130 |
| |
| |||
149 | 139 |
| |
150 | 140 |
| |
151 | 141 |
| |
152 | - | ||
153 | 142 |
| |
154 | 143 |
| |
155 | 144 |
| |
| |||
167 | 156 |
| |
168 | 157 |
| |
169 | 158 |
| |
170 | - | ||
171 | 159 |
| |
172 | 160 |
| |
173 | 161 |
| |
| |||
181 | 169 |
| |
182 | 170 |
| |
183 | 171 |
| |
184 | - | ||
185 | 172 |
| |
186 | 173 |
| |
187 | 174 |
| |
| |||
193 | 180 |
| |
194 | 181 |
| |
195 | 182 |
| |
196 | - | ||
197 | 183 |
| |
198 | 184 |
| |
199 | 185 |
| |
| |||
206 | 192 |
| |
207 | 193 |
| |
208 | 194 |
| |
209 | - | ||
210 | 195 |
| |
211 | 196 |
| |
212 | 197 |
| |
| |||
226 | 211 |
| |
227 | 212 |
| |
228 | 213 |
| |
229 | - | ||
230 | 214 |
| |
231 | 215 |
| |
232 | 216 |
| |
| |||
248 | 232 |
| |
249 | 233 |
| |
250 | 234 |
| |
251 | - | ||
252 | 235 |
| |
253 | 236 |
| |
254 | 237 |
| |
| |||
264 | 247 |
| |
265 | 248 |
| |
266 | 249 |
| |
267 | - | ||
268 | 250 |
| |
269 | 251 |
| |
270 | 252 |
| |
| |||
348 | 330 |
| |
349 | 331 |
| |
350 | 332 |
| |
351 | - | ||
333 | + | ||
352 | 334 |
| |
353 | 335 |
| |
354 | - | ||
355 | - | ||
356 | - | ||
357 | - | ||
358 | - | ||
359 | - | ||
360 | - | ||
361 | - | ||
362 | - | ||
363 | - | ||
364 | - | ||
365 | - | ||
366 | - | ||
367 | - | ||
368 | - | ||
369 | - | ||
370 | - | ||
371 | - | ||
372 | - | ||
373 | - | ||
374 | - | ||
375 | - | ||
376 | - | ||
377 | - | ||
378 | - | ||
379 | - | ||
380 | - | ||
381 | - | ||
382 | - | ||
383 | - | ||
384 | - | ||
385 | - | ||
386 | - | ||
387 | - | ||
388 | - | ||
389 | - | ||
390 | - | ||
391 | - | ||
392 | - | ||
393 | - | ||
394 | - | ||
395 | 336 |
| |
396 | 337 |
| |
397 | 338 |
| |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
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 | + |
This file was deleted.
0 commit comments