about summary refs log tree commit diff
path: root/src/comp/middle
diff options
context:
space:
mode:
authorNiko Matsakis <niko@alum.mit.edu>2012-01-18 12:04:07 -0800
committerNiko Matsakis <niko@alum.mit.edu>2012-01-19 07:10:59 -0800
commit1f0b3d2247ce6ff381f572450dbe733291ffe01a (patch)
tree81684fe3aedb300ae6b4db297a06e6cfb9555176 /src/comp/middle
parentd54cc1cad4b913fd0a96091674175227ce9f021a (diff)
treat fn*() as fn&()
This is not my ideal way of going about things.  I'd prefer not
to have expressions typed as fn*(), for example, but I couldn't
get that to work together with inferring the modes of arguments
and other corner cases.
Diffstat (limited to 'src/comp/middle')
-rw-r--r--src/comp/middle/shape.rs3
-rw-r--r--src/comp/middle/trans_closure.rs3
2 files changed, 3 insertions, 3 deletions
diff --git a/src/comp/middle/shape.rs b/src/comp/middle/shape.rs
index 9986400dfa3..bb3de341df1 100644
--- a/src/comp/middle/shape.rs
+++ b/src/comp/middle/shape.rs
@@ -432,7 +432,8 @@ fn shape_of(ccx: @crate_ctxt, t: ty::t, ty_param_map: [uint]) -> [u8] {
       ty::ty_fn({proto: ast::proto_uniq, _}) {
         s += [shape_uniq_fn];
       }
-      ty::ty_fn({proto: ast::proto_block, _}) {
+      ty::ty_fn({proto: ast::proto_block, _}) |
+      ty::ty_fn({proto: ast::proto_any, _}) {
         s += [shape_stack_fn];
       }
       ty::ty_fn({proto: ast::proto_bare, _}) {
diff --git a/src/comp/middle/trans_closure.rs b/src/comp/middle/trans_closure.rs
index 1e58ea53f9f..4915a975322 100644
--- a/src/comp/middle/trans_closure.rs
+++ b/src/comp/middle/trans_closure.rs
@@ -528,8 +528,7 @@ fn trans_expr_fn(bcx: @block_ctxt,
     };
 
     let closure = alt proto {
-      ast::proto_any { fail "proto_any cannot appear in an expr"; }
-      ast::proto_block { trans_closure_env(ty::ck_block) }
+      ast::proto_any | ast::proto_block { trans_closure_env(ty::ck_block) }
       ast::proto_box { trans_closure_env(ty::ck_box) }
       ast::proto_uniq { trans_closure_env(ty::ck_uniq) }
       ast::proto_bare {