Skip to content

Commit

Permalink
TAIT: remove OpaqueTy in AST.
Browse files Browse the repository at this point in the history
  • Loading branch information
Centril committed Nov 14, 2019
1 parent a2491ee commit 6a49b52
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 38 deletions.
6 changes: 0 additions & 6 deletions src/libsyntax/ast.rs
Expand Up @@ -1579,7 +1579,6 @@ pub enum ImplItemKind {
Const(P<Ty>, P<Expr>),
Method(FnSig, P<Block>),
TyAlias(P<Ty>),
OpaqueTy(GenericBounds),
Macro(Mac),
}

Expand Down Expand Up @@ -2483,10 +2482,6 @@ pub enum ItemKind {
///
/// E.g., `type Foo = Bar<u8>;`.
TyAlias(P<Ty>, 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<A, B> { C<A>, D<B> }`.
Expand Down Expand Up @@ -2540,7 +2535,6 @@ impl ItemKind {
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",
Expand Down
5 changes: 0 additions & 5 deletions src/libsyntax/mut_visit.rs
Expand Up @@ -887,10 +887,6 @@ pub fn noop_visit_item_kind<T: MutVisitor>(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);
Expand Down Expand Up @@ -970,7 +966,6 @@ pub fn noop_flat_map_impl_item<T: MutVisitor>(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);
Expand Down
20 changes: 0 additions & 20 deletions src/libsyntax/print/pprust.rs
Expand Up @@ -1255,19 +1255,6 @@ impl<'a> State<'a> {
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,
Expand Down Expand Up @@ -1620,13 +1607,6 @@ impl<'a> State<'a> {
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 {
Expand Down
7 changes: 0 additions & 7 deletions src/libsyntax/visit.rs
Expand Up @@ -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)
Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit 6a49b52

Please sign in to comment.