Commit ec82174
authored
Rollup merge of rust-lang#67131 - Centril:item-merge, r=petrochenkov
Merge `TraitItem` & `ImplItem into `AssocItem`
In this PR we:
- Merge `{Trait,Impl}Item{Kind?}` into `AssocItem{Kind?}` as discussed in rust-lang#65041 (comment).
- This is done by using the cover grammar of both forms.
- In particular, it requires that we syntactically allow (under `#[cfg(FALSE)]`):
- `default`ness on `trait` items,
- `impl` items without a body / definition (`const`, `type`, and `fn`),
- and associated `type`s in `impl`s with bounds, e.g., `type Foo: Ord;`.
- The syntactic restrictions are replaced by semantic ones in `ast_validation`.
- Move syntactic restrictions around C-variadic parameters from the parser into `ast_validation`:
- `fn`s in all contexts now syntactically allow `...`,
- `...` can occur anywhere in the list syntactically (`fn foo(..., x: usize) {}`),
- and `...` can be the sole parameter (`fn foo(...) {}`.
r? @petrochenkovFile tree
65 files changed
+1279
-849
lines changed- src
- librustc_error_codes/error_codes
- librustc_interface
- librustc_lint
- librustc_parse
- parser
- librustc_passes
- librustc_resolve
- librustc_save_analysis
- librustc
- hir
- lowering
- lint
- libsyntax_expand
- libsyntax_ext/deriving/generic
- libsyntax
- attr
- feature_gate
- print
- util
- test/ui
- c-variadic
- did_you_mean
- feature-gates
- invalid
- issues
- parser
- macro
- mismatched-braces
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
65 files changed
+1279
-849
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
477 | 477 | | |
478 | 478 | | |
479 | 479 | | |
480 | | - | |
| 480 | + | |
481 | 481 | | |
482 | 482 | | |
483 | 483 | | |
484 | | - | |
| 484 | + | |
485 | 485 | | |
486 | 486 | | |
487 | 487 | | |
| |||
493 | 493 | | |
494 | 494 | | |
495 | 495 | | |
496 | | - | |
| 496 | + | |
497 | 497 | | |
498 | 498 | | |
499 | 499 | | |
| |||
1211 | 1211 | | |
1212 | 1212 | | |
1213 | 1213 | | |
1214 | | - | |
| 1214 | + | |
1215 | 1215 | | |
1216 | 1216 | | |
1217 | 1217 | | |
| |||
1253 | 1253 | | |
1254 | 1254 | | |
1255 | 1255 | | |
| 1256 | + | |
| 1257 | + | |
| 1258 | + | |
| 1259 | + | |
| 1260 | + | |
| 1261 | + | |
| 1262 | + | |
| 1263 | + | |
1256 | 1264 | | |
1257 | 1265 | | |
1258 | 1266 | | |
| |||
1418 | 1426 | | |
1419 | 1427 | | |
1420 | 1428 | | |
1421 | | - | |
| 1429 | + | |
| 1430 | + | |
| 1431 | + | |
| 1432 | + | |
| 1433 | + | |
| 1434 | + | |
| 1435 | + | |
1422 | 1436 | | |
1423 | 1437 | | |
1424 | 1438 | | |
| |||
2084 | 2098 | | |
2085 | 2099 | | |
2086 | 2100 | | |
2087 | | - | |
2088 | | - | |
| 2101 | + | |
| 2102 | + | |
| 2103 | + | |
| 2104 | + | |
| 2105 | + | |
| 2106 | + | |
| 2107 | + | |
| 2108 | + | |
| 2109 | + | |
| 2110 | + | |
2089 | 2111 | | |
2090 | 2112 | | |
2091 | | - | |
2092 | | - | |
2093 | | - | |
2094 | | - | |
2095 | | - | |
2096 | | - | |
2097 | | - | |
2098 | | - | |
2099 | | - | |
2100 | | - | |
2101 | | - | |
2102 | | - | |
2103 | | - | |
2104 | | - | |
2105 | | - | |
2106 | | - | |
2107 | | - | |
2108 | | - | |
2109 | | - | |
2110 | | - | |
2111 | | - | |
2112 | | - | |
| 2113 | + | |
2113 | 2114 | | |
2114 | 2115 | | |
2115 | 2116 | | |
| |||
2474 | 2475 | | |
2475 | 2476 | | |
2476 | 2477 | | |
2477 | | - | |
| 2478 | + | |
2478 | 2479 | | |
2479 | 2480 | | |
2480 | 2481 | | |
2481 | 2482 | | |
2482 | | - | |
2483 | | - | |
2484 | | - | |
2485 | | - | |
2486 | | - | |
2487 | | - | |
| 2483 | + | |
| 2484 | + | |
2488 | 2485 | | |
2489 | 2486 | | |
2490 | 2487 | | |
| |||
2496 | 2493 | | |
2497 | 2494 | | |
2498 | 2495 | | |
2499 | | - | |
2500 | | - | |
2501 | | - | |
2502 | | - | |
2503 | | - | |
2504 | | - | |
2505 | | - | |
2506 | | - | |
2507 | | - | |
2508 | | - | |
| 2496 | + | |
| 2497 | + | |
2509 | 2498 | | |
2510 | 2499 | | |
2511 | 2500 | | |
| |||
3017 | 3006 | | |
3018 | 3007 | | |
3019 | 3008 | | |
3020 | | - | |
| 3009 | + | |
3021 | 3010 | | |
3022 | 3011 | | |
3023 | 3012 | | |
| |||
0 commit comments