Skip to content

Commit bf82582

Browse files
committedFeb 7, 2020
add hir printing
1 parent ab6ea2b commit bf82582

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed
 

‎src/librustc_hir/print.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -454,14 +454,17 @@ impl<'a> State<'a> {
454454
fn print_associated_type(
455455
&mut self,
456456
ident: ast::Ident,
457+
generics: &hir::Generics<'_>,
457458
bounds: Option<hir::GenericBounds<'_>>,
458459
ty: Option<&hir::Ty<'_>>,
459460
) {
460461
self.word_space("type");
461462
self.print_ident(ident);
463+
self.print_generic_params(&generics.params);
462464
if let Some(bounds) = bounds {
463465
self.print_bounds(":", bounds);
464466
}
467+
self.print_where_clause(&generics.where_clause);
465468
if let Some(ty) = ty {
466469
self.s.space();
467470
self.word_space("=");
@@ -902,6 +905,7 @@ impl<'a> State<'a> {
902905
hir::TraitItemKind::Type(ref bounds, ref default) => {
903906
self.print_associated_type(
904907
ti.ident,
908+
&ti.generics,
905909
Some(bounds),
906910
default.as_ref().map(|ty| &**ty),
907911
);
@@ -930,7 +934,7 @@ impl<'a> State<'a> {
930934
self.ann.nested(self, Nested::Body(body));
931935
}
932936
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));
934938
}
935939
hir::ImplItemKind::OpaqueTy(bounds) => {
936940
self.word_space("type");

0 commit comments

Comments
 (0)