Skip to content

Commit fe2f106

Browse files
committed
---
yaml --- r: 6690 b: refs/heads/master c: 7fbca4e h: refs/heads/master v: v3
1 parent b037463 commit fe2f106

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: aa1cd61c84199c8a1e44645e4af3f8c15c6dd018
2+
refs/heads/master: 7fbca4e31ce51ac4b7cae155780730e1ab2dccb4

trunk/src/comp/middle/resolve.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -678,9 +678,14 @@ fn scope_is_fn(sc: scope) -> bool {
678678
};
679679
}
680680

681+
// Returns:
682+
// none - does not close
683+
// some(true) - closes and permits mutation
684+
// some(false) - closes but no mutation
681685
fn scope_closes(sc: scope) -> option::t<bool> {
682686
alt sc {
683687
scope_fn(_, ast::proto_block., _) { some(true) }
688+
scope_fn(_, ast::proto_send., _) { some(false) }
684689
scope_fn(_, ast::proto_shared(_), _) { some(false) }
685690
_ { none }
686691
}

trunk/src/comp/middle/trans.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2192,7 +2192,7 @@ fn trans_expr_fn(bcx: @block_ctxt, f: ast::_fn, sp: span,
21922192
|| f.proto == ast::proto_shared(ast::sugar_sexy);
21932193
let env;
21942194
alt f.proto {
2195-
ast::proto_block. | ast::proto_shared(_) {
2195+
ast::proto_block. | ast::proto_shared(_) | ast::proto_send. {
21962196
let upvars = get_freevars(ccx.tcx, id);
21972197
let env_r = build_closure(bcx, upvars, copying);
21982198
env = env_r.ptr;
@@ -2201,7 +2201,7 @@ fn trans_expr_fn(bcx: @block_ctxt, f: ast::_fn, sp: span,
22012201
load_environment(bcx, fcx, env_r.ptrty, upvars, copying);
22022202
});
22032203
}
2204-
_ {
2204+
ast::proto_bare. {
22052205
env = C_null(T_opaque_closure_ptr(ccx));
22062206
trans_closure(sub_cx, sp, f, llfn, none, [], id, {|_fcx|});
22072207
}

0 commit comments

Comments
 (0)