TAIT: remove OpaqueTy
in AST.
This commit is contained in:
parent
a2491ee4e6
commit
6a49b523be
4 changed files with 0 additions and 38 deletions
|
@ -1579,7 +1579,6 @@ pub enum ImplItemKind {
|
||||||
Const(P<Ty>, P<Expr>),
|
Const(P<Ty>, P<Expr>),
|
||||||
Method(FnSig, P<Block>),
|
Method(FnSig, P<Block>),
|
||||||
TyAlias(P<Ty>),
|
TyAlias(P<Ty>),
|
||||||
OpaqueTy(GenericBounds),
|
|
||||||
Macro(Mac),
|
Macro(Mac),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2483,10 +2482,6 @@ pub enum ItemKind {
|
||||||
///
|
///
|
||||||
/// E.g., `type Foo = Bar<u8>;`.
|
/// E.g., `type Foo = Bar<u8>;`.
|
||||||
TyAlias(P<Ty>, Generics),
|
TyAlias(P<Ty>, Generics),
|
||||||
/// An opaque `impl Trait` type alias.
|
|
||||||
///
|
|
||||||
/// E.g., `type Foo = impl Bar + Boo;`.
|
|
||||||
OpaqueTy(GenericBounds, Generics),
|
|
||||||
/// An enum definition (`enum`).
|
/// An enum definition (`enum`).
|
||||||
///
|
///
|
||||||
/// E.g., `enum Foo<A, B> { C<A>, D<B> }`.
|
/// E.g., `enum Foo<A, B> { C<A>, D<B> }`.
|
||||||
|
@ -2540,7 +2535,6 @@ impl ItemKind {
|
||||||
ItemKind::ForeignMod(..) => "foreign module",
|
ItemKind::ForeignMod(..) => "foreign module",
|
||||||
ItemKind::GlobalAsm(..) => "global asm",
|
ItemKind::GlobalAsm(..) => "global asm",
|
||||||
ItemKind::TyAlias(..) => "type alias",
|
ItemKind::TyAlias(..) => "type alias",
|
||||||
ItemKind::OpaqueTy(..) => "opaque type",
|
|
||||||
ItemKind::Enum(..) => "enum",
|
ItemKind::Enum(..) => "enum",
|
||||||
ItemKind::Struct(..) => "struct",
|
ItemKind::Struct(..) => "struct",
|
||||||
ItemKind::Union(..) => "union",
|
ItemKind::Union(..) => "union",
|
||||||
|
|
|
@ -887,10 +887,6 @@ pub fn noop_visit_item_kind<T: MutVisitor>(kind: &mut ItemKind, vis: &mut T) {
|
||||||
vis.visit_ty(ty);
|
vis.visit_ty(ty);
|
||||||
vis.visit_generics(generics);
|
vis.visit_generics(generics);
|
||||||
}
|
}
|
||||||
ItemKind::OpaqueTy(bounds, generics) => {
|
|
||||||
visit_bounds(bounds, vis);
|
|
||||||
vis.visit_generics(generics);
|
|
||||||
}
|
|
||||||
ItemKind::Enum(EnumDef { variants }, generics) => {
|
ItemKind::Enum(EnumDef { variants }, generics) => {
|
||||||
variants.flat_map_in_place(|variant| vis.flat_map_variant(variant));
|
variants.flat_map_in_place(|variant| vis.flat_map_variant(variant));
|
||||||
vis.visit_generics(generics);
|
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);
|
visitor.visit_block(body);
|
||||||
}
|
}
|
||||||
ImplItemKind::TyAlias(ty) => visitor.visit_ty(ty),
|
ImplItemKind::TyAlias(ty) => visitor.visit_ty(ty),
|
||||||
ImplItemKind::OpaqueTy(bounds) => visit_bounds(bounds, visitor),
|
|
||||||
ImplItemKind::Macro(mac) => visitor.visit_mac(mac),
|
ImplItemKind::Macro(mac) => visitor.visit_mac(mac),
|
||||||
}
|
}
|
||||||
visitor.visit_span(span);
|
visitor.visit_span(span);
|
||||||
|
|
|
@ -1255,19 +1255,6 @@ impl<'a> State<'a> {
|
||||||
self.s.word(";");
|
self.s.word(";");
|
||||||
self.end(); // end the outer ibox
|
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) => {
|
ast::ItemKind::Enum(ref enum_definition, ref params) => {
|
||||||
self.print_enum_def(
|
self.print_enum_def(
|
||||||
enum_definition,
|
enum_definition,
|
||||||
|
@ -1620,13 +1607,6 @@ impl<'a> State<'a> {
|
||||||
ast::ImplItemKind::TyAlias(ref ty) => {
|
ast::ImplItemKind::TyAlias(ref ty) => {
|
||||||
self.print_associated_type(ii.ident, None, Some(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) => {
|
ast::ImplItemKind::Macro(ref mac) => {
|
||||||
self.print_mac(mac);
|
self.print_mac(mac);
|
||||||
match mac.delim {
|
match mac.delim {
|
||||||
|
|
|
@ -263,10 +263,6 @@ pub fn walk_item<'a, V: Visitor<'a>>(visitor: &mut V, item: &'a Item) {
|
||||||
visitor.visit_ty(typ);
|
visitor.visit_ty(typ);
|
||||||
visitor.visit_generics(generics)
|
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) => {
|
ItemKind::Enum(ref enum_definition, ref generics) => {
|
||||||
visitor.visit_generics(generics);
|
visitor.visit_generics(generics);
|
||||||
visitor.visit_enum_def(enum_definition, generics, item.id, item.span)
|
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) => {
|
ImplItemKind::TyAlias(ref ty) => {
|
||||||
visitor.visit_ty(ty);
|
visitor.visit_ty(ty);
|
||||||
}
|
}
|
||||||
ImplItemKind::OpaqueTy(ref bounds) => {
|
|
||||||
walk_list!(visitor, visit_param_bound, bounds);
|
|
||||||
}
|
|
||||||
ImplItemKind::Macro(ref mac) => {
|
ImplItemKind::Macro(ref mac) => {
|
||||||
visitor.visit_mac(mac);
|
visitor.visit_mac(mac);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue