Skip to content

Commit 12ce0c2

Browse files
committed
Remove outdated syntax from trait alias pretty printing
1 parent c5351ad commit 12ce0c2

File tree

2 files changed

+3
-25
lines changed
  • compiler
    • rustc_ast_pretty/src/pprust/state
    • rustc_hir_pretty/src

2 files changed

+3
-25
lines changed

compiler/rustc_ast_pretty/src/pprust/state/item.rs

+2-13
Original file line numberDiff line numberDiff line change
@@ -348,21 +348,10 @@ impl<'a> State<'a> {
348348
self.head(visibility_qualified(&item.vis, "trait"));
349349
self.print_ident(item.ident);
350350
self.print_generic_params(&generics.params);
351-
let mut real_bounds = Vec::with_capacity(bounds.len());
352-
// FIXME(durka) this seems to be some quite outdated syntax
353-
for b in bounds.iter() {
354-
if let GenericBound::Trait(ptr, ast::TraitBoundModifier::Maybe) = b {
355-
self.space();
356-
self.word_space("for ?");
357-
self.print_trait_ref(&ptr.trait_ref);
358-
} else {
359-
real_bounds.push(b.clone());
360-
}
361-
}
362351
self.nbsp();
363-
if !real_bounds.is_empty() {
352+
if !bounds.is_empty() {
364353
self.word_nbsp("=");
365-
self.print_type_bounds(&real_bounds);
354+
self.print_type_bounds(&bounds);
366355
}
367356
self.print_where_clause(&generics.where_clause);
368357
self.word(";");

compiler/rustc_hir_pretty/src/lib.rs

+1-12
Original file line numberDiff line numberDiff line change
@@ -695,19 +695,8 @@ impl<'a> State<'a> {
695695
self.head("trait");
696696
self.print_ident(item.ident);
697697
self.print_generic_params(generics.params);
698-
let mut real_bounds = Vec::with_capacity(bounds.len());
699-
// FIXME(durka) this seems to be some quite outdated syntax
700-
for b in bounds {
701-
if let GenericBound::Trait(ptr, hir::TraitBoundModifier::Maybe) = b {
702-
self.space();
703-
self.word_space("for ?");
704-
self.print_trait_ref(&ptr.trait_ref);
705-
} else {
706-
real_bounds.push(b);
707-
}
708-
}
709698
self.nbsp();
710-
self.print_bounds("=", real_bounds);
699+
self.print_bounds("=", bounds);
711700
self.print_where_clause(generics);
712701
self.word(";");
713702
self.end(); // end inner head-block

0 commit comments

Comments
 (0)