Skip to content

Commit 73936ab

Browse files
committed
print generic bounds on associated types
1 parent b5e21db commit 73936ab

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/librustc_ast_pretty/pprust.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1074,12 +1074,15 @@ impl<'a> State<'a> {
10741074
fn print_associated_type(
10751075
&mut self,
10761076
ident: ast::Ident,
1077+
generics: &ast::Generics,
10771078
bounds: &ast::GenericBounds,
10781079
ty: Option<&ast::Ty>,
10791080
) {
10801081
self.word_space("type");
10811082
self.print_ident(ident);
1083+
self.print_generic_params(&generics.params);
10821084
self.print_type_bounds(":", bounds);
1085+
self.print_where_clause(&generics.where_clause);
10831086
if let Some(ty) = ty {
10841087
self.s.space();
10851088
self.word_space("=");
@@ -1474,7 +1477,7 @@ impl<'a> State<'a> {
14741477
self.print_fn_full(sig, item.ident, &item.generics, &item.vis, body, &item.attrs);
14751478
}
14761479
ast::AssocItemKind::TyAlias(bounds, ty) => {
1477-
self.print_associated_type(item.ident, bounds, ty.as_deref());
1480+
self.print_associated_type(item.ident, &item.generics, bounds, ty.as_deref());
14781481
}
14791482
ast::AssocItemKind::Macro(mac) => {
14801483
self.print_mac(mac);

0 commit comments

Comments
 (0)