about summary refs log tree commit diff
path: root/src/libsyntax/visit.rs
diff options
context:
space:
mode:
authorTyler Mandry <tmandry@gmail.com>2019-11-15 14:44:47 +0100
committerGitHub <noreply@github.com>2019-11-15 14:44:47 +0100
commitc5bb2ec0dd1f6f38117ec0e7e22c077a4b74dc09 (patch)
tree2804bcc92024c0ad0d0a1fa39fd820630286b75c /src/libsyntax/visit.rs
parentce36ab2b064c2aa716084d79717c64cc04bb6532 (diff)
parent03cf0d737f075aa8839dd7cc5b1047910ec00ddf (diff)
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
Diffstat (limited to 'src/libsyntax/visit.rs')
-rw-r--r--src/libsyntax/visit.rs7
1 files changed, 0 insertions, 7 deletions
diff --git a/src/libsyntax/visit.rs b/src/libsyntax/visit.rs
index ea2dc357e6e..2597ffd750d 100644
--- a/src/libsyntax/visit.rs
+++ b/src/libsyntax/visit.rs
@@ -263,10 +263,6 @@ pub fn walk_item<'a, V: Visitor<'a>>(visitor: &mut V, item: &'a Item) {
             visitor.visit_ty(typ);
             visitor.visit_generics(generics)
         }
-        ItemKind::OpaqueTy(ref bounds, ref generics) => {
-            walk_list!(visitor, visit_param_bound, bounds);
-            visitor.visit_generics(generics)
-        }
         ItemKind::Enum(ref enum_definition, ref generics) => {
             visitor.visit_generics(generics);
             visitor.visit_enum_def(enum_definition, generics, item.id, item.span)
@@ -628,9 +624,6 @@ pub fn walk_impl_item<'a, V: Visitor<'a>>(visitor: &mut V, impl_item: &'a ImplIt
         ImplItemKind::TyAlias(ref ty) => {
             visitor.visit_ty(ty);
         }
-        ImplItemKind::OpaqueTy(ref bounds) => {
-            walk_list!(visitor, visit_param_bound, bounds);
-        }
         ImplItemKind::Macro(ref mac) => {
             visitor.visit_mac(mac);
         }