about summary refs log tree commit diff
path: root/src/libsyntax/print
diff options
context:
space:
mode:
authorTim Chevalier <chevalier@alum.wellesley.edu>2012-10-23 11:28:20 -0700
committerTim Chevalier <chevalier@alum.wellesley.edu>2012-10-23 12:10:19 -0700
commit087cbb55d06d833033e463b9c3a4237c04264319 (patch)
tree3f7f21846979bbd2a3d19930e58aee3699d97c21 /src/libsyntax/print
parent48c8d1fecd55098e87cdb9c027c2675a22df370f (diff)
downloadrust-087cbb55d06d833033e463b9c3a4237c04264319.tar.gz
rust-087cbb55d06d833033e463b9c3a4237c04264319.zip
Remove <- operator from the compiler
Yield an obsolete syntax error on things like "let foo <- bar;"
and "foo <- bar;" r=brson

Progress on #3466
Diffstat (limited to 'src/libsyntax/print')
-rw-r--r--src/libsyntax/print/pprust.rs17
1 files changed, 4 insertions, 13 deletions
diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs
index d68b28c6836..4a5e85c9eb6 100644
--- a/src/libsyntax/print/pprust.rs
+++ b/src/libsyntax/print/pprust.rs
@@ -1310,18 +1310,13 @@ fn print_expr(s: ps, &&expr: @ast::expr) {
         print_block(s, blk);
       }
       ast::expr_copy(e) => { word_space(s, ~"copy"); print_expr(s, e); }
+        // shouldn't parenthesize unless it's needed
       ast::expr_unary_move(e) => {
           popen(s);
           word_space(s, ~"move");
           print_expr(s, e);
           pclose(s);
       }
-      ast::expr_move(lhs, rhs) => {
-        print_expr(s, lhs);
-        space(s.s);
-        word_space(s, ~"<-");
-        print_expr(s, rhs);
-      }
       ast::expr_assign(lhs, rhs) => {
         print_expr(s, lhs);
         space(s.s);
@@ -1416,8 +1411,7 @@ fn print_expr_parens_if_not_bot(s: ps, ex: @ast::expr) {
     let parens = match ex.node {
       ast::expr_fail(_) | ast::expr_ret(_) |
       ast::expr_binary(_, _, _) | ast::expr_unary(_, _) |
-      ast::expr_move(_, _) | ast::expr_copy(_) |
-      ast::expr_assign(_, _) |
+      ast::expr_copy(_) | ast::expr_assign(_, _) |
       ast::expr_assign_op(_, _, _) | ast::expr_swap(_, _) |
       ast::expr_log(_, _, _) | ast::expr_assert(_) |
       ast::expr_call(_, _, true) |
@@ -1458,11 +1452,8 @@ fn print_decl(s: ps, decl: @ast::decl) {
             match loc.node.init {
               Some(init) => {
                 nbsp(s);
-                match init.op {
-                  ast::init_assign => word_space(s, ~"="),
-                  ast::init_move => word_space(s, ~"<-")
-                }
-                print_expr(s, init.expr);
+                word_space(s, ~"=");
+                print_expr(s, init);
               }
               _ => ()
             }