};
}
+// Returns:
+// none - does not close
+// some(true) - closes and permits mutation
+// some(false) - closes but no mutation
fn scope_closes(sc: scope) -> option::t<bool> {
alt sc {
scope_fn(_, ast::proto_block., _) { some(true) }
+ scope_fn(_, ast::proto_send., _) { some(false) }
scope_fn(_, ast::proto_shared(_), _) { some(false) }
_ { none }
}
|| f.proto == ast::proto_shared(ast::sugar_sexy);
let env;
alt f.proto {
- ast::proto_block. | ast::proto_shared(_) {
+ ast::proto_block. | ast::proto_shared(_) | ast::proto_send. {
let upvars = get_freevars(ccx.tcx, id);
let env_r = build_closure(bcx, upvars, copying);
env = env_r.ptr;
load_environment(bcx, fcx, env_r.ptrty, upvars, copying);
});
}
- _ {
+ ast::proto_bare. {
env = C_null(T_opaque_closure_ptr(ccx));
trans_closure(sub_cx, sp, f, llfn, none, [], id, {|_fcx|});
}