summary refs log tree commit diff
path: root/src/libsyntax/print
diff options
context:
space:
mode:
authorBrian Anderson <banderson@mozilla.com>2012-06-19 19:34:01 -0700
committerBrian Anderson <banderson@mozilla.com>2012-06-20 17:27:28 -0700
commit4dcf84e4f4a9a54254fd426609ad9f1ccffae3b9 (patch)
tree487ddbc8454889971d4487744d8143410be097f1 /src/libsyntax/print
parentbcd3942f41252b989029683c33e61b3c92bf92ac (diff)
downloadrust-4dcf84e4f4a9a54254fd426609ad9f1ccffae3b9.tar.gz
rust-4dcf84e4f4a9a54254fd426609ad9f1ccffae3b9.zip
Remove bind. Issue #2189
Diffstat (limited to 'src/libsyntax/print')
-rw-r--r--src/libsyntax/print/pprust.rs24
1 files changed, 3 insertions, 21 deletions
diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs
index e0e30dc72fc..6bd9e79b727 100644
--- a/src/libsyntax/print/pprust.rs
+++ b/src/libsyntax/print/pprust.rs
@@ -102,7 +102,7 @@ fn typarams_to_str(tps: [ast::ty_param]) -> str {
 }
 
 fn path_to_str(&&p: @ast::path) -> str {
-    ret to_str(p, bind print_path(_, _, false));
+    ret to_str(p, {|a,b|print_path(a, b, false)});
 }
 
 fn fun_to_str(decl: ast::fn_decl, name: ast::ident,
@@ -840,7 +840,7 @@ fn print_mac(s: ps, m: ast::mac) {
           some(@{node: ast::expr_vec(_, _), _}) { }
           _ { word(s.s, " "); }
         }
-        option::iter(arg, bind print_expr(s, _));
+        option::iter(arg, {|a|print_expr(s, a)});
         // FIXME: extension 'body' (#2339)
       }
       ast::mac_embed_type(ty) {
@@ -938,24 +938,6 @@ fn print_expr(s: ps, &&expr: @ast::expr) {
             print_expr(s, option::get(blk));
         }
       }
-      ast::expr_bind(func, args) {
-        fn print_opt(s: ps, expr: option<@ast::expr>) {
-            alt expr {
-              some(expr) { print_expr(s, expr); }
-              _ { word(s.s, "_"); }
-            }
-        }
-
-        // "bind" keyword is only needed if there are no "_" arguments.
-        if !vec::any(args) {|arg| option::is_none(arg) } {
-            word_nbsp(s, "bind");
-        }
-
-        print_expr(s, func);
-        popen(s);
-        commasep(s, inconsistent, args, print_opt);
-        pclose(s);
-      }
       ast::expr_binary(op, lhs, rhs) {
         let prec = operator_prec(op);
         print_op_maybe_parens(s, lhs, prec);
@@ -1780,7 +1762,7 @@ fn ast_ty_fn_constr_to_str(&&c: @ast::constr) -> str {
 }
 
 fn ast_fn_constr_to_str(decl: ast::fn_decl, &&c: @ast::constr) -> str {
-    let arg_to_str = bind fn_arg_idx_to_str(decl, _);
+    let arg_to_str = {|a|fn_arg_idx_to_str(decl, a)};
     ret path_to_str(c.node.path) +
             constr_args_to_str(arg_to_str, c.node.args);
 }