Skip to content

Commit 6b619b1

Browse files
committed
TAIT: remove OpaqueTy in AST.
1 parent e2fa952 commit 6b619b1

File tree

4 files changed

+0
-38
lines changed

4 files changed

+0
-38
lines changed

src/libsyntax/ast.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1554,7 +1554,6 @@ pub enum ImplItemKind {
15541554
Const(P<Ty>, P<Expr>),
15551555
Method(FnSig, P<Block>),
15561556
TyAlias(P<Ty>),
1557-
OpaqueTy(GenericBounds),
15581557
Macro(Mac),
15591558
}
15601559

@@ -2448,10 +2447,6 @@ pub enum ItemKind {
24482447
///
24492448
/// E.g., `type Foo = Bar<u8>;`.
24502449
TyAlias(P<Ty>, Generics),
2451-
/// An opaque `impl Trait` type alias.
2452-
///
2453-
/// E.g., `type Foo = impl Bar + Boo;`.
2454-
OpaqueTy(GenericBounds, Generics),
24552450
/// An enum definition (`enum`).
24562451
///
24572452
/// E.g., `enum Foo<A, B> { C<A>, D<B> }`.
@@ -2505,7 +2500,6 @@ impl ItemKind {
25052500
ItemKind::ForeignMod(..) => "foreign module",
25062501
ItemKind::GlobalAsm(..) => "global asm",
25072502
ItemKind::TyAlias(..) => "type alias",
2508-
ItemKind::OpaqueTy(..) => "opaque type",
25092503
ItemKind::Enum(..) => "enum",
25102504
ItemKind::Struct(..) => "struct",
25112505
ItemKind::Union(..) => "union",

src/libsyntax/mut_visit.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -887,10 +887,6 @@ pub fn noop_visit_item_kind<T: MutVisitor>(kind: &mut ItemKind, vis: &mut T) {
887887
vis.visit_ty(ty);
888888
vis.visit_generics(generics);
889889
}
890-
ItemKind::OpaqueTy(bounds, generics) => {
891-
visit_bounds(bounds, vis);
892-
vis.visit_generics(generics);
893-
}
894890
ItemKind::Enum(EnumDef { variants }, generics) => {
895891
variants.flat_map_in_place(|variant| vis.flat_map_variant(variant));
896892
vis.visit_generics(generics);
@@ -970,7 +966,6 @@ pub fn noop_flat_map_impl_item<T: MutVisitor>(mut item: ImplItem, visitor: &mut
970966
visitor.visit_block(body);
971967
}
972968
ImplItemKind::TyAlias(ty) => visitor.visit_ty(ty),
973-
ImplItemKind::OpaqueTy(bounds) => visit_bounds(bounds, visitor),
974969
ImplItemKind::Macro(mac) => visitor.visit_mac(mac),
975970
}
976971
visitor.visit_span(span);

src/libsyntax/print/pprust.rs

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1255,19 +1255,6 @@ impl<'a> State<'a> {
12551255
self.s.word(";");
12561256
self.end(); // end the outer ibox
12571257
}
1258-
ast::ItemKind::OpaqueTy(ref bounds, ref generics) => {
1259-
self.head(visibility_qualified(&item.vis, "type"));
1260-
self.print_ident(item.ident);
1261-
self.word_space("= impl");
1262-
self.print_generic_params(&generics.params);
1263-
self.end(); // end the inner ibox
1264-
1265-
self.print_where_clause(&generics.where_clause);
1266-
self.s.space();
1267-
self.print_type_bounds(":", bounds);
1268-
self.s.word(";");
1269-
self.end(); // end the outer ibox
1270-
}
12711258
ast::ItemKind::Enum(ref enum_definition, ref params) => {
12721259
self.print_enum_def(
12731260
enum_definition,
@@ -1620,13 +1607,6 @@ impl<'a> State<'a> {
16201607
ast::ImplItemKind::TyAlias(ref ty) => {
16211608
self.print_associated_type(ii.ident, None, Some(ty));
16221609
}
1623-
ast::ImplItemKind::OpaqueTy(ref bounds) => {
1624-
self.word_space("type");
1625-
self.print_ident(ii.ident);
1626-
self.word_space("= impl");
1627-
self.print_type_bounds(":", bounds);
1628-
self.s.word(";");
1629-
}
16301610
ast::ImplItemKind::Macro(ref mac) => {
16311611
self.print_mac(mac);
16321612
match mac.delim {

src/libsyntax/visit.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -263,10 +263,6 @@ pub fn walk_item<'a, V: Visitor<'a>>(visitor: &mut V, item: &'a Item) {
263263
visitor.visit_ty(typ);
264264
visitor.visit_generics(generics)
265265
}
266-
ItemKind::OpaqueTy(ref bounds, ref generics) => {
267-
walk_list!(visitor, visit_param_bound, bounds);
268-
visitor.visit_generics(generics)
269-
}
270266
ItemKind::Enum(ref enum_definition, ref generics) => {
271267
visitor.visit_generics(generics);
272268
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
628624
ImplItemKind::TyAlias(ref ty) => {
629625
visitor.visit_ty(ty);
630626
}
631-
ImplItemKind::OpaqueTy(ref bounds) => {
632-
walk_list!(visitor, visit_param_bound, bounds);
633-
}
634627
ImplItemKind::Macro(ref mac) => {
635628
visitor.visit_mac(mac);
636629
}

0 commit comments

Comments
 (0)