]> git.lizzy.rs Git - rust.git/commit
Rollup merge of #66197 - Centril:transparent-ast, r=varkor
authorTyler Mandry <tmandry@gmail.com>
Fri, 15 Nov 2019 13:44:47 +0000 (14:44 +0100)
committerGitHub <noreply@github.com>
Fri, 15 Nov 2019 13:44:47 +0000 (14:44 +0100)
commitc5bb2ec0dd1f6f38117ec0e7e22c077a4b74dc09
tree2804bcc92024c0ad0d0a1fa39fd820630286b75c
parentce36ab2b064c2aa716084d79717c64cc04bb6532
parent03cf0d737f075aa8839dd7cc5b1047910ec00ddf
Rollup merge of #66197 - Centril:transparent-ast, r=varkor

Push `ast::{ItemKind, ImplItemKind}::OpaqueTy` hack down into lowering

We currently have a hack in the form of `ast::{ItemKind, ImplItemKind}::OpaqueTy` which is constructed literally when you write `type Alias = impl Trait;` but not e.g. `type Alias = Vec<impl Trait>;`. Per https://github.com/rust-lang/rfcs/pull/2515, this needs to change to allow `impl Trait` in nested positions.  This PR achieves this change for the syntactic aspect but not the semantic one, which will require changes in lowering and def collection. In the interim, `TyKind::opaque_top_hack` is introduced to avoid knock-on changes in lowering, collection, and resolve. These hacks can then be removed and fixed one by one until the desired semantics are supported.

r? @varkor
src/librustc/hir/lowering.rs
src/librustc/hir/lowering/item.rs
src/librustc_parse/parser/item.rs
src/librustc_passes/ast_validation.rs
src/librustc_resolve/build_reduced_graph.rs
src/librustc_resolve/late.rs
src/libsyntax/feature_gate/check.rs