Skip to content

Commit

Permalink
print generic bounds on associated types
Browse files Browse the repository at this point in the history
  • Loading branch information
basil-cow committed Feb 7, 2020
1 parent b5e21db commit 73936ab
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/librustc_ast_pretty/pprust.rs
Expand Up @@ -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("=");
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 73936ab

Please sign in to comment.