TAIT: remove OpaqueTy in AST.

This commit is contained in:
Mazdak Farrokhzad 2019-11-07 14:56:49 +01:00
parent a2491ee4e6
commit 6a49b523be
4 changed files with 0 additions and 38 deletions

View File

@ -1579,7 +1579,6 @@ pub enum ImplItemKind {
Const(P<Ty>, P<Expr>),
Method(FnSig, P<Block>),
TyAlias(P<Ty>),
OpaqueTy(GenericBounds),
Macro(Mac),
}
@ -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> }`.
@ -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",

View File

@ -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);
@ -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);

View File

@ -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 {

View File

@ -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);
}