]> git.lizzy.rs Git - rust.git/commitdiff
Fix pretty printing of HRTB syntax
authorBrian Koropoff <bkoropoff@gmail.com>
Sun, 14 Dec 2014 03:11:04 +0000 (19:11 -0800)
committerBrian Koropoff <bkoropoff@gmail.com>
Tue, 16 Dec 2014 02:26:06 +0000 (18:26 -0800)
src/libsyntax/print/pprust.rs

index db122f271a9c45f81da830b4f06b1f7330636b98..b08cf1112fbcfdb897b55019a765b8033e179042 100644 (file)
@@ -1005,8 +1005,13 @@ fn print_trait_ref(&mut self, t: &ast::TraitRef) -> IoResult<()> {
     fn print_poly_trait_ref(&mut self, t: &ast::PolyTraitRef) -> IoResult<()> {
         if !t.bound_lifetimes.is_empty() {
             try!(word(&mut self.s, "for<"));
+            let mut comma = false;
             for lifetime_def in t.bound_lifetimes.iter() {
+                if comma {
+                    try!(self.word_space(","))
+                }
                 try!(self.print_lifetime_def(lifetime_def));
+                comma = true;
             }
             try!(word(&mut self.s, ">"));
         }