about summary refs log tree commit diff
path: root/src/libsyntax/print
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2015-01-05 18:36:30 -0800
committerAlex Crichton <alex@alexcrichton.com>2015-01-05 18:36:30 -0800
commit3d9923d0d5b1c3e9ad9756751cb54ec22492cff1 (patch)
tree07c524bb20a48c89c9389a424064a173d50a31f0 /src/libsyntax/print
parent0dd07429ab71e832de1206a5f07a81f2c71f8c13 (diff)
parentc02fac471a9126e971617449a55930b0d69058c0 (diff)
downloadrust-3d9923d0d5b1c3e9ad9756751cb54ec22492cff1.tar.gz
rust-3d9923d0d5b1c3e9ad9756751cb54ec22492cff1.zip
rollup merge of #20424: jroesch/tuple-struct-where-clause-fix
Fixes #17904. All the cases that I believe we should support are detailed in the test case, let me know if there is there is any more desired behavior. cc @japaric.

r? @nikomatsakis or whoever is appropriate.
Diffstat (limited to 'src/libsyntax/print')
-rw-r--r--src/libsyntax/print/pprust.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs
index e44cc2257c2..effd6e8218d 100644
--- a/src/libsyntax/print/pprust.rs
+++ b/src/libsyntax/print/pprust.rs
@@ -1056,7 +1056,6 @@ impl<'a> State<'a> {
                         span: codemap::Span) -> IoResult<()> {
         try!(self.print_ident(ident));
         try!(self.print_generics(generics));
-        try!(self.print_where_clause(generics));
         if ast_util::struct_def_is_tuple_like(struct_def) {
             if !struct_def.fields.is_empty() {
                 try!(self.popen());
@@ -1075,10 +1074,12 @@ impl<'a> State<'a> {
                 ));
                 try!(self.pclose());
             }
+            try!(self.print_where_clause(generics));
             try!(word(&mut self.s, ";"));
             try!(self.end());
             self.end() // close the outer-box
         } else {
+            try!(self.print_where_clause(generics));
             try!(self.nbsp());
             try!(self.bopen());
             try!(self.hardbreak_if_not_bol());