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 15:38:34 -0700
committerGraydon Hoare <graydon@mozilla.com>2011-07-26 15:41:42 -0700
commitba626779de957ac5d21bd23cb95febf75354a14f (patch)
tree82417b012b6f3ef0cee10787e708d9274e580fd9 /src/comp/syntax
parent1c97510a1677a93fea9d893325c828daee833b1e (diff)
Handle printing 'auto' occurring in loop-variable context.
Diffstat (limited to 'src/comp/syntax')
-rw-r--r--src/comp/syntax/print/pprust.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/comp/syntax/print/pprust.rs b/src/comp/syntax/print/pprust.rs
index e73546b3cc4..24e9581446f 100644
--- a/src/comp/syntax/print/pprust.rs
+++ b/src/comp/syntax/print/pprust.rs
@@ -1086,7 +1086,10 @@ fn print_decl(&ps s, &@ast::decl decl) {
 fn print_ident(&ps s, &ast::ident ident) { word(s.s, ident); }
 
 fn print_for_decl(&ps s, @ast::local loc) {
-    print_type(s, *option::get(loc.node.ty));
+    alt (loc.node.ty) {
+      none { word(s.s, "auto"); }
+      some (?t) { print_type(s, *t); }
+    }
     space(s.s);
     word(s.s, loc.node.ident);
 }