about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorMikhail Babenko <misha-babenko@yandex.ru>2020-02-07 04:03:54 +0300
committerMikhail Babenko <misha-babenko@yandex.ru>2020-02-07 18:18:07 +0300
commit73936ab57ad567802a613157ae9db0cccf31eda3 (patch)
tree743c8519dfb87bf40e6564c74ebc2189f7b3ad44 /src
parentb5e21dbb5cabdaaadc47a4d8e3f59979dcad2871 (diff)
print generic bounds on associated types
Diffstat (limited to 'src')
-rw-r--r--src/librustc_ast_pretty/pprust.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/librustc_ast_pretty/pprust.rs b/src/librustc_ast_pretty/pprust.rs
index d9077d1606f..78bf149f0e0 100644
--- a/src/librustc_ast_pretty/pprust.rs
+++ b/src/librustc_ast_pretty/pprust.rs
@@ -1074,12 +1074,15 @@ impl<'a> State<'a> {
     fn print_associated_type(
         &mut self,
         ident: ast::Ident,
+        generics: &ast::Generics,
         bounds: &ast::GenericBounds,
         ty: Option<&ast::Ty>,
     ) {
         self.word_space("type");
         self.print_ident(ident);
+        self.print_generic_params(&generics.params);
         self.print_type_bounds(":", bounds);
+        self.print_where_clause(&generics.where_clause);
         if let Some(ty) = ty {
             self.s.space();
             self.word_space("=");
@@ -1474,7 +1477,7 @@ impl<'a> State<'a> {
                 self.print_fn_full(sig, item.ident, &item.generics, &item.vis, body, &item.attrs);
             }
             ast::AssocItemKind::TyAlias(bounds, ty) => {
-                self.print_associated_type(item.ident, bounds, ty.as_deref());
+                self.print_associated_type(item.ident, &item.generics, bounds, ty.as_deref());
             }
             ast::AssocItemKind::Macro(mac) => {
                 self.print_mac(mac);