Updating kind rules to make sure we don't sneakily send ports.

This commit is contained in:
Eric Holk 2012-06-19 17:28:29 -07:00
parent 3cf582b529
commit e30a8b6f8c
2 changed files with 12 additions and 1 deletions

View File

@ -1608,7 +1608,7 @@ fn type_kind(cx: ctxt, ty: t) -> kind {
}
ty_res(did, inner, tps) {
let inner = subst(cx, tps, inner);
(kind_const() & type_kind(cx, inner)) | kind_send_only()
(kind_const() | kind_send_only()) & type_kind(cx, inner)
}
ty_param(_, did) {
param_bounds_to_kind(cx.ty_param_bounds.get(did.node))

View File

@ -0,0 +1,11 @@
fn main() {
resource foo(_x: comm::port<()>) {}
let x = ~mut some(foo(comm::port()));
task::spawn {|move x| //! ERROR not a sendable value
let mut y = none;
*x <-> y;
log(error, y);
}
}