Fix unclosed boxes in pretty printing of TraitAlias
This commit is contained in:
@@ -1354,9 +1354,7 @@ impl<'a> State<'a> {
|
|||||||
self.bclose(item.span, empty);
|
self.bclose(item.span, empty);
|
||||||
}
|
}
|
||||||
ast::ItemKind::TraitAlias(ref generics, ref bounds) => {
|
ast::ItemKind::TraitAlias(ref generics, ref bounds) => {
|
||||||
self.head("");
|
self.head(visibility_qualified(&item.vis, "trait"));
|
||||||
self.print_visibility(&item.vis);
|
|
||||||
self.word_nbsp("trait");
|
|
||||||
self.print_ident(item.ident);
|
self.print_ident(item.ident);
|
||||||
self.print_generic_params(&generics.params);
|
self.print_generic_params(&generics.params);
|
||||||
let mut real_bounds = Vec::with_capacity(bounds.len());
|
let mut real_bounds = Vec::with_capacity(bounds.len());
|
||||||
@@ -1374,6 +1372,8 @@ impl<'a> State<'a> {
|
|||||||
self.print_type_bounds("=", &real_bounds);
|
self.print_type_bounds("=", &real_bounds);
|
||||||
self.print_where_clause(&generics.where_clause);
|
self.print_where_clause(&generics.where_clause);
|
||||||
self.word(";");
|
self.word(";");
|
||||||
|
self.end(); // end inner head-block
|
||||||
|
self.end(); // end outer head-block
|
||||||
}
|
}
|
||||||
ast::ItemKind::MacCall(ref mac) => {
|
ast::ItemKind::MacCall(ref mac) => {
|
||||||
self.print_mac(mac);
|
self.print_mac(mac);
|
||||||
|
|||||||
@@ -705,9 +705,7 @@ impl<'a> State<'a> {
|
|||||||
self.bclose(item.span);
|
self.bclose(item.span);
|
||||||
}
|
}
|
||||||
hir::ItemKind::TraitAlias(ref generics, ref bounds) => {
|
hir::ItemKind::TraitAlias(ref generics, ref bounds) => {
|
||||||
self.head("");
|
self.head(visibility_qualified(&item.vis, "trait"));
|
||||||
self.print_visibility(&item.vis);
|
|
||||||
self.word_nbsp("trait");
|
|
||||||
self.print_ident(item.ident);
|
self.print_ident(item.ident);
|
||||||
self.print_generic_params(&generics.params);
|
self.print_generic_params(&generics.params);
|
||||||
let mut real_bounds = Vec::with_capacity(bounds.len());
|
let mut real_bounds = Vec::with_capacity(bounds.len());
|
||||||
@@ -725,6 +723,8 @@ impl<'a> State<'a> {
|
|||||||
self.print_bounds("=", real_bounds);
|
self.print_bounds("=", real_bounds);
|
||||||
self.print_where_clause(&generics.where_clause);
|
self.print_where_clause(&generics.where_clause);
|
||||||
self.word(";");
|
self.word(";");
|
||||||
|
self.end(); // end inner head-block
|
||||||
|
self.end(); // end outer head-block
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
self.ann.post(self, AnnNode::Item(item))
|
self.ann.post(self, AnnNode::Item(item))
|
||||||
|
|||||||
@@ -589,7 +589,7 @@ fn test_item() {
|
|||||||
stringify_item!(
|
stringify_item!(
|
||||||
pub trait Trait<T> = Sized where T: 'a;
|
pub trait Trait<T> = Sized where T: 'a;
|
||||||
),
|
),
|
||||||
"", // FIXME
|
"pub trait Trait<T> = Sized where T: 'a;",
|
||||||
);
|
);
|
||||||
|
|
||||||
// ItemKind::Impl
|
// ItemKind::Impl
|
||||||
|
|||||||
Reference in New Issue
Block a user