Skip to content

Commit 4ab27b2

Browse files
committed
fix ppaux
1 parent 571a15b commit 4ab27b2

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/librustc/util/ppaux.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -712,6 +712,7 @@ define_print! {
712712
ty::tls::with(|tcx| {
713713
// Use a type that can't appear in defaults of type parameters.
714714
let dummy_self = tcx.mk_infer(ty::FreshTy(0));
715+
let mut first = true;
715716

716717
if let Some(principal) = self.principal() {
717718
let principal = tcx
@@ -724,11 +725,17 @@ define_print! {
724725
.with_self_ty(tcx, dummy_self)
725726
}).collect::<Vec<_>>();
726727
cx.parameterized(f, principal.substs, principal.def_id, &projections)?;
728+
first = false;
727729
}
728730

729731
// Builtin bounds.
730732
for did in self.auto_traits() {
731-
write!(f, " + {}", tcx.item_path_str(did))?;
733+
if !first {
734+
write!(f, " + ")?;
735+
}
736+
first = false;
737+
738+
write!(f, "{}", tcx.item_path_str(did))?;
732739
}
733740

734741
Ok(())

0 commit comments

Comments
 (0)