diff options
| author | bors <bors@rust-lang.org> | 2019-08-03 02:21:23 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2019-08-03 02:21:23 +0000 |
| commit | d7270712cb446aad0817040bbca73a8d024f67b0 (patch) | |
| tree | 22cf18615b2177381934d771fc3710e6fd04c257 /src/libsyntax/print | |
| parent | d9bd4b289f07956819c59704d88d9eed61af3a6d (diff) | |
| parent | fbd7e0cf0e31ab612343311a61fe4f58a76a1698 (diff) | |
| download | rust-d7270712cb446aad0817040bbca73a8d024f67b0.tar.gz rust-d7270712cb446aad0817040bbca73a8d024f67b0.zip | |
Auto merge of #63180 - varkor:trait-alias-impl-trait, r=Centril
Change opaque type syntax from `existential type` to type alias `impl Trait` This implements a new feature gate `type_alias_impl_trait` (this is slightly different from the originally proposed feature name, but matches what has been used in discussion since), deprecating the old `existential_types` feature. The syntax for opaque types has been changed. In addition, the "existential" terminology has been replaced with "opaque", as per previous discussion and the RFC. This makes partial progress towards implementing https://github.com/rust-lang/rust/issues/63063. r? @Centril
Diffstat (limited to 'src/libsyntax/print')
| -rw-r--r-- | src/libsyntax/print/pprust.rs | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs index 07b1aef337f..e61e1113dca 100644 --- a/src/libsyntax/print/pprust.rs +++ b/src/libsyntax/print/pprust.rs @@ -1221,9 +1221,10 @@ impl<'a> State<'a> { self.s.word(";"); self.end(); // end the outer ibox } - ast::ItemKind::Existential(ref bounds, ref generics) => { - self.head(visibility_qualified(&item.vis, "existential type")); + 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 @@ -1581,9 +1582,12 @@ impl<'a> State<'a> { ast::ImplItemKind::Type(ref ty) => { self.print_associated_type(ii.ident, None, Some(ty)); } - ast::ImplItemKind::Existential(ref bounds) => { - self.word_space("existential"); - self.print_associated_type(ii.ident, Some(bounds), None); + 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); |
