diff options
| author | Tyler Mandry <tmandry@gmail.com> | 2019-11-15 14:44:47 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-11-15 14:44:47 +0100 |
| commit | c5bb2ec0dd1f6f38117ec0e7e22c077a4b74dc09 (patch) | |
| tree | 2804bcc92024c0ad0d0a1fa39fd820630286b75c /src/libsyntax/print | |
| parent | ce36ab2b064c2aa716084d79717c64cc04bb6532 (diff) | |
| parent | 03cf0d737f075aa8839dd7cc5b1047910ec00ddf (diff) | |
Rollup merge of #66197 - Centril:transparent-ast, r=varkor
Push `ast::{ItemKind, ImplItemKind}::OpaqueTy` hack down into lowering
We currently have a hack in the form of `ast::{ItemKind, ImplItemKind}::OpaqueTy` which is constructed literally when you write `type Alias = impl Trait;` but not e.g. `type Alias = Vec<impl Trait>;`. Per https://github.com/rust-lang/rfcs/pull/2515, this needs to change to allow `impl Trait` in nested positions. This PR achieves this change for the syntactic aspect but not the semantic one, which will require changes in lowering and def collection. In the interim, `TyKind::opaque_top_hack` is introduced to avoid knock-on changes in lowering, collection, and resolve. These hacks can then be removed and fixed one by one until the desired semantics are supported.
r? @varkor
Diffstat (limited to 'src/libsyntax/print')
| -rw-r--r-- | src/libsyntax/print/pprust.rs | 20 |
1 files changed, 0 insertions, 20 deletions
diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs index f154b7bde98..ef65a744e83 100644 --- a/src/libsyntax/print/pprust.rs +++ b/src/libsyntax/print/pprust.rs @@ -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, @@ -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 { |
