Remove outdated syntax from trait alias pretty printing
This commit is contained in:
parent
c5351ad4dc
commit
12ce0c2a89
2 changed files with 3 additions and 25 deletions
|
@ -348,21 +348,10 @@ impl<'a> State<'a> {
|
||||||
self.head(visibility_qualified(&item.vis, "trait"));
|
self.head(visibility_qualified(&item.vis, "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());
|
|
||||||
// FIXME(durka) this seems to be some quite outdated syntax
|
|
||||||
for b in bounds.iter() {
|
|
||||||
if let GenericBound::Trait(ptr, ast::TraitBoundModifier::Maybe) = b {
|
|
||||||
self.space();
|
|
||||||
self.word_space("for ?");
|
|
||||||
self.print_trait_ref(&ptr.trait_ref);
|
|
||||||
} else {
|
|
||||||
real_bounds.push(b.clone());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
self.nbsp();
|
self.nbsp();
|
||||||
if !real_bounds.is_empty() {
|
if !bounds.is_empty() {
|
||||||
self.word_nbsp("=");
|
self.word_nbsp("=");
|
||||||
self.print_type_bounds(&real_bounds);
|
self.print_type_bounds(&bounds);
|
||||||
}
|
}
|
||||||
self.print_where_clause(&generics.where_clause);
|
self.print_where_clause(&generics.where_clause);
|
||||||
self.word(";");
|
self.word(";");
|
||||||
|
|
|
@ -695,19 +695,8 @@ impl<'a> State<'a> {
|
||||||
self.head("trait");
|
self.head("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());
|
|
||||||
// FIXME(durka) this seems to be some quite outdated syntax
|
|
||||||
for b in bounds {
|
|
||||||
if let GenericBound::Trait(ptr, hir::TraitBoundModifier::Maybe) = b {
|
|
||||||
self.space();
|
|
||||||
self.word_space("for ?");
|
|
||||||
self.print_trait_ref(&ptr.trait_ref);
|
|
||||||
} else {
|
|
||||||
real_bounds.push(b);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
self.nbsp();
|
self.nbsp();
|
||||||
self.print_bounds("=", real_bounds);
|
self.print_bounds("=", bounds);
|
||||||
self.print_where_clause(generics);
|
self.print_where_clause(generics);
|
||||||
self.word(";");
|
self.word(";");
|
||||||
self.end(); // end inner head-block
|
self.end(); // end inner head-block
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue