about summary refs log tree commit diff
path: root/src/comp/syntax
diff options
context:
space:
mode:
authorGraydon Hoare <graydon@mozilla.com>2011-07-26 16:28:16 -0700
committerGraydon Hoare <graydon@mozilla.com>2011-07-26 16:28:16 -0700
commit797cd9fd0ec2a27d4a755d8b22419912f1353bd3 (patch)
tree5a5e64ead24d7f657fde476e891f5cc9c810077a /src/comp/syntax
parent4070b75914cd3b6b891aa5868e77c1921e76eb62 (diff)
downloadrust-797cd9fd0ec2a27d4a755d8b22419912f1353bd3.tar.gz
rust-797cd9fd0ec2a27d4a755d8b22419912f1353bd3.zip
Try to keep the local and its type together when wrapping a long decl.
Diffstat (limited to 'src/comp/syntax')
-rw-r--r--src/comp/syntax/print/pprust.rs10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/comp/syntax/print/pprust.rs b/src/comp/syntax/print/pprust.rs
index fb27b2ebd1a..f5cf6ba1072 100644
--- a/src/comp/syntax/print/pprust.rs
+++ b/src/comp/syntax/print/pprust.rs
@@ -1056,13 +1056,17 @@ fn print_decl(&ps s, &@ast::decl decl) {
             ibox(s, indent_unit);
             word_nbsp(s, "let");
             fn print_local(&ps s, &@ast::local loc) {
-                word(s.s, loc.node.ident);
-                alt (loc.node.ty) {
+                alt loc.node.ty {
                   some(?ty) {
+                    ibox(s, indent_unit);
+                    word(s.s, loc.node.ident);
                     word_space(s, ":");
                     print_type(s, *ty);
+                    end(s);
+                  }
+                  _ {
+                    word(s.s, loc.node.ident);
                   }
-                  _ {}
                 }
                 alt loc.node.init {
                   some(?init) {