Skip to content

Commit 6a49b52

Browse files
committed
TAIT: remove OpaqueTy in AST.
1 parent a2491ee commit 6a49b52

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
@@ -1579,7 +1579,6 @@ pub enum ImplItemKind {
15791579
Const(P<Ty>, P<Expr>),
15801580
Method(FnSig, P<Block>),
15811581
TyAlias(P<Ty>),
1582-
OpaqueTy(GenericBounds),
15831582
Macro(Mac),
15841583
}
15851584

@@ -2483,10 +2482,6 @@ pub enum ItemKind {
24832482
///
24842483
/// E.g., `type Foo = Bar<u8>;`.
24852484
TyAlias(P<Ty>, Generics),
2486-
/// An opaque `impl Trait` type alias.
2487-
///
2488-
/// E.g., `type Foo = impl Bar + Boo;`.
2489-
OpaqueTy(GenericBounds, Generics),
24902485
/// An enum definition (`enum`).
24912486
///
24922487
/// E.g., `enum Foo<A, B> { C<A>, D<B> }`.
@@ -2540,7 +2535,6 @@ impl ItemKind {
25402535
ItemKind::ForeignMod(..) => "foreign module",
25412536
ItemKind::GlobalAsm(..) => "global asm",
25422537
ItemKind::TyAlias(..) => "type alias",
2543-
ItemKind::OpaqueTy(..) => "opaque type",
25442538
ItemKind::Enum(..) => "enum",
25452539
ItemKind::Struct(..) => "struct",
25462540
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)