about summary refs log tree commit diff
path: root/src/libsyntax
diff options
context:
space:
mode:
authorPatrick Walton <pcwalton@mimiga.net>2012-08-03 19:49:12 -0700
committerPatrick Walton <pcwalton@mimiga.net>2012-08-03 19:49:12 -0700
commitf23674394f2e77b7aa4686a5ae9f2f60d6faa428 (patch)
tree4c4d8d805f80254a9aa2f2788d288e053d88fe62 /src/libsyntax
parent51a5a4ad0e2501b260a8059a72e4b0eebe78d6f9 (diff)
downloadrust-f23674394f2e77b7aa4686a5ae9f2f60d6faa428.tar.gz
rust-f23674394f2e77b7aa4686a5ae9f2f60d6faa428.zip
rustc: Merge fn& and fn in favor of fn&.
This is a step on the way to moving the function "proto" sigil out front.
Diffstat (limited to 'src/libsyntax')
-rw-r--r--src/libsyntax/ast.rs3
-rw-r--r--src/libsyntax/ext/auto_serialize.rs8
-rw-r--r--src/libsyntax/parse/parser.rs19
-rw-r--r--src/libsyntax/print/pprust.rs1
4 files changed, 13 insertions, 18 deletions
diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs
index cc06049bd45..27cd21d1d9f 100644
--- a/src/libsyntax/ast.rs
+++ b/src/libsyntax/ast.rs
@@ -178,7 +178,6 @@ enum mutability { m_mutbl, m_imm, m_const, }
 #[auto_serialize]
 enum proto {
     proto_bare,    // foreign fn
-    proto_any,     // fn
     proto_uniq,    // fn~
     proto_box,     // fn@
     proto_block,   // fn&
@@ -195,7 +194,7 @@ enum vstore {
 
 pure fn is_blockish(p: ast::proto) -> bool {
     alt p {
-      proto_any | proto_block { true }
+      proto_block { true }
       proto_bare | proto_uniq | proto_box { false }
     }
 }
diff --git a/src/libsyntax/ext/auto_serialize.rs b/src/libsyntax/ext/auto_serialize.rs
index 90319feb4d2..cc37b5cc8d0 100644
--- a/src/libsyntax/ext/auto_serialize.rs
+++ b/src/libsyntax/ext/auto_serialize.rs
@@ -186,10 +186,10 @@ impl helpers of ext_ctxt_helpers for ext_ctxt {
         };
 
         @{id: self.next_id(),
-          node: ast::ty_fn(ast::proto_any, {inputs: args,
-                                            output: output,
-                                            purity: ast::impure_fn,
-                                            cf: ast::return_val}),
+          node: ast::ty_fn(ast::proto_block, {inputs: args,
+                                              output: output,
+                                              purity: ast::impure_fn,
+                                              cf: ast::return_val}),
           span: span}
     }
 
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs
index c76a82a5c9b..4769e4ab384 100644
--- a/src/libsyntax/parse/parser.rs
+++ b/src/libsyntax/parse/parser.rs
@@ -41,13 +41,13 @@ import ast::{_mod, add, alt_check, alt_exhaustive, arg, arm, attribute,
              match_nonterminal, match_seq, match_tok, method, mode, mt, mul,
              mutability, neg, noreturn, not, pat, pat_box, pat_enum,
              pat_ident, pat_lit, pat_range, pat_rec, pat_tup, pat_uniq,
-             pat_wild, path, private, proto, proto_any, proto_bare,
-             proto_block, proto_box, proto_uniq, provided, public, pure_fn,
-             purity, re_anon, re_named, region, rem, required, ret_style,
-             return_val, self_ty, shl, shr, stmt, stmt_decl, stmt_expr,
-             stmt_semi, subtract, sty_box, sty_by_ref, sty_region, sty_uniq,
-             sty_value, token_tree, trait_method, trait_ref, tt_delim, tt_seq,
-             tt_tok, tt_nonterminal, ty, ty_, ty_bot, ty_box, ty_field, ty_fn,
+             pat_wild, path, private, proto, proto_bare, proto_block,
+             proto_box, proto_uniq, provided, public, pure_fn, purity,
+             re_anon, re_named, region, rem, required, ret_style, return_val,
+             self_ty, shl, shr, stmt, stmt_decl, stmt_expr, stmt_semi,
+             subtract, sty_box, sty_by_ref, sty_region, sty_uniq, sty_value,
+             token_tree, trait_method, trait_ref, tt_delim, tt_seq, tt_tok,
+             tt_nonterminal, ty, ty_, ty_bot, ty_box, ty_field, ty_fn,
              ty_infer, ty_mac, ty_method, ty_nil, ty_param, ty_path, ty_ptr,
              ty_rec, ty_rptr, ty_tup, ty_u32, ty_uniq, ty_vec,
              ty_fixed_length, unchecked_blk, uniq, unsafe_blk, unsafe_fn,
@@ -801,9 +801,6 @@ class parser {
             let proto = self.parse_fn_ty_proto();
             alt proto {
               proto_bare { self.fatal(~"fn expr are deprecated, use fn@"); }
-              proto_any {
-                self.fatal(~"fn* cannot be used in an expression");
-              }
               _ { /* fallthrough */ }
             }
             return pexpr(self.parse_fn_expr(proto));
@@ -2781,7 +2778,7 @@ class parser {
             proto_block
           }
           _ {
-            proto_any
+            proto_block
           }
         }
     }
diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs
index 9eccf688233..eaacf6cd424 100644
--- a/src/libsyntax/print/pprust.rs
+++ b/src/libsyntax/print/pprust.rs
@@ -1823,7 +1823,6 @@ fn print_purity(s: ps, p: ast::purity) {
 fn proto_to_str(p: ast::proto) -> ~str {
     return alt p {
       ast::proto_bare { ~"extern fn" }
-      ast::proto_any { ~"fn" }
       ast::proto_block { ~"fn&" }
       ast::proto_uniq { ~"fn~" }
       ast::proto_box { ~"fn@" }