@@ -454,14 +454,17 @@ impl<'a> State<'a> {
454
454
fn print_associated_type (
455
455
& mut self ,
456
456
ident : ast:: Ident ,
457
+ generics : & hir:: Generics < ' _ > ,
457
458
bounds : Option < hir:: GenericBounds < ' _ > > ,
458
459
ty : Option < & hir:: Ty < ' _ > > ,
459
460
) {
460
461
self . word_space ( "type" ) ;
461
462
self . print_ident ( ident) ;
463
+ self . print_generic_params ( & generics. params ) ;
462
464
if let Some ( bounds) = bounds {
463
465
self . print_bounds ( ":" , bounds) ;
464
466
}
467
+ self . print_where_clause ( & generics. where_clause ) ;
465
468
if let Some ( ty) = ty {
466
469
self . s . space ( ) ;
467
470
self . word_space ( "=" ) ;
@@ -902,6 +905,7 @@ impl<'a> State<'a> {
902
905
hir:: TraitItemKind :: Type ( ref bounds, ref default) => {
903
906
self . print_associated_type (
904
907
ti. ident ,
908
+ & ti. generics ,
905
909
Some ( bounds) ,
906
910
default. as_ref ( ) . map ( |ty| & * * ty) ,
907
911
) ;
@@ -930,7 +934,7 @@ impl<'a> State<'a> {
930
934
self . ann . nested ( self , Nested :: Body ( body) ) ;
931
935
}
932
936
hir:: ImplItemKind :: TyAlias ( ref ty) => {
933
- self . print_associated_type ( ii. ident , None , Some ( ty) ) ;
937
+ self . print_associated_type ( ii. ident , & ii . generics , None , Some ( ty) ) ;
934
938
}
935
939
hir:: ImplItemKind :: OpaqueTy ( bounds) => {
936
940
self . word_space ( "type" ) ;
0 commit comments