]> git.lizzy.rs Git - rust.git/commit - src/tools/clippy
Rollup merge of #67131 - Centril:item-merge, r=petrochenkov
authorMazdak Farrokhzad <twingoow@gmail.com>
Fri, 20 Dec 2019 16:22:19 +0000 (17:22 +0100)
committerGitHub <noreply@github.com>
Fri, 20 Dec 2019 16:22:19 +0000 (17:22 +0100)
commitec82174fad385882798b6c223dc1b8ac44f58332
tree0602c23ea16b14f9f76377c3506143575df88c3c
parentba1a4882514c3262caff38deabc30b669c709b95
parent054458b48db87ce767d7cc3d2dd86846ada3e3da
Rollup merge of #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 https://github.com/rust-lang/rust/issues/65041#issuecomment-538105286.

   - 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? @petrochenkov
src/librustc/hir/lowering.rs
src/librustc_interface/util.rs
src/libsyntax/ast.rs
src/libsyntax/feature_gate/check.rs
src/libsyntax_expand/base.rs
src/libsyntax_expand/expand.rs