diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs index 13bf6752ba2..4cfa9988570 100644 --- a/src/libsyntax/ast.rs +++ b/src/libsyntax/ast.rs @@ -1579,7 +1579,6 @@ pub enum ImplItemKind { Const(P, P), Method(FnSig, P), TyAlias(P), - OpaqueTy(GenericBounds), Macro(Mac), } @@ -2483,10 +2482,6 @@ pub enum ItemKind { /// /// E.g., `type Foo = Bar;`. TyAlias(P, Generics), - /// An opaque `impl Trait` type alias. - /// - /// E.g., `type Foo = impl Bar + Boo;`. - OpaqueTy(GenericBounds, Generics), /// An enum definition (`enum`). /// /// E.g., `enum Foo { C, D }`. @@ -2540,7 +2535,6 @@ pub fn descriptive_variant(&self) -> &str { ItemKind::ForeignMod(..) => "foreign module", ItemKind::GlobalAsm(..) => "global asm", ItemKind::TyAlias(..) => "type alias", - ItemKind::OpaqueTy(..) => "opaque type", ItemKind::Enum(..) => "enum", ItemKind::Struct(..) => "struct", ItemKind::Union(..) => "union", diff --git a/src/libsyntax/mut_visit.rs b/src/libsyntax/mut_visit.rs index 376323a83ea..f4ef993edb9 100644 --- a/src/libsyntax/mut_visit.rs +++ b/src/libsyntax/mut_visit.rs @@ -887,10 +887,6 @@ pub fn noop_visit_item_kind(kind: &mut ItemKind, vis: &mut T) { vis.visit_ty(ty); vis.visit_generics(generics); } - ItemKind::OpaqueTy(bounds, generics) => { - visit_bounds(bounds, vis); - vis.visit_generics(generics); - } ItemKind::Enum(EnumDef { variants }, generics) => { variants.flat_map_in_place(|variant| vis.flat_map_variant(variant)); vis.visit_generics(generics); @@ -970,7 +966,6 @@ pub fn noop_flat_map_impl_item(mut item: ImplItem, visitor: &mut visitor.visit_block(body); } ImplItemKind::TyAlias(ty) => visitor.visit_ty(ty), - ImplItemKind::OpaqueTy(bounds) => visit_bounds(bounds, visitor), ImplItemKind::Macro(mac) => visitor.visit_mac(mac), } visitor.visit_span(span); diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs index f154b7bde98..ef65a744e83 100644 --- a/src/libsyntax/print/pprust.rs +++ b/src/libsyntax/print/pprust.rs @@ -1255,19 +1255,6 @@ fn print_associated_type(&mut self, self.s.word(";"); self.end(); // end the outer ibox } - ast::ItemKind::OpaqueTy(ref bounds, ref generics) => { - self.head(visibility_qualified(&item.vis, "type")); - self.print_ident(item.ident); - self.word_space("= impl"); - self.print_generic_params(&generics.params); - self.end(); // end the inner ibox - - self.print_where_clause(&generics.where_clause); - self.s.space(); - self.print_type_bounds(":", bounds); - self.s.word(";"); - self.end(); // end the outer ibox - } ast::ItemKind::Enum(ref enum_definition, ref params) => { self.print_enum_def( enum_definition, @@ -1620,13 +1607,6 @@ fn print_poly_trait_ref(&mut self, t: &ast::PolyTraitRef) { ast::ImplItemKind::TyAlias(ref ty) => { self.print_associated_type(ii.ident, None, Some(ty)); } - ast::ImplItemKind::OpaqueTy(ref bounds) => { - self.word_space("type"); - self.print_ident(ii.ident); - self.word_space("= impl"); - self.print_type_bounds(":", bounds); - self.s.word(";"); - } ast::ImplItemKind::Macro(ref mac) => { self.print_mac(mac); match mac.delim { 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); }