summary refs log tree commit diff
path: root/src/libsyntax
diff options
context:
space:
mode:
authorBenjamin Herr <ben@0x539.de>2013-09-17 22:13:47 +0200
committerBenjamin Herr <ben@0x539.de>2013-09-17 23:41:42 +0200
commit823ebb14ba6ed99df1198c6d1b47c5d2964196da (patch)
tree1047ddd74cf9fa39470ee33199c6038b01101d13 /src/libsyntax
parentaa406c151e7404029760e56338f9ebc92319a5d5 (diff)
downloadrust-823ebb14ba6ed99df1198c6d1b47c5d2964196da.tar.gz
rust-823ebb14ba6ed99df1198c6d1b47c5d2964196da.zip
pp: also print bounds in paths with no generic params
Since 3b6314c3 the pretty printer seems to only print trait bounds for
`ast::ty_path(...)`s that have a generics arguments list. That seems
wrong, so let's always print them.

Closes #9253, un-xfails test for #7673.
Diffstat (limited to 'src/libsyntax')
-rw-r--r--src/libsyntax/print/pprust.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs
index ec84cbda973..b5868cbc63d 100644
--- a/src/libsyntax/print/pprust.rs
+++ b/src/libsyntax/print/pprust.rs
@@ -1535,15 +1535,15 @@ fn print_path_(s: @ps,
 
         print_ident(s, segment.identifier);
 
-        if segment.lifetime.is_some() || !segment.types.is_empty() {
-            // If this is the last segment, print the bounds.
-            if i == path.segments.len() - 1 {
-                match *opt_bounds {
-                    None => {}
-                    Some(ref bounds) => print_bounds(s, bounds, true),
-                }
+        // If this is the last segment, print the bounds.
+        if i == path.segments.len() - 1 {
+            match *opt_bounds {
+                None => {}
+                Some(ref bounds) => print_bounds(s, bounds, true),
             }
+        }
 
+        if segment.lifetime.is_some() || !segment.types.is_empty() {
             if colons_before_params {
                 word(s.s, "::")
             }