diff --git a/src/rustc/middle/ty.rs b/src/rustc/middle/ty.rs index 8af47f10bb4..890295490e9 100644 --- a/src/rustc/middle/ty.rs +++ b/src/rustc/middle/ty.rs @@ -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)) diff --git a/src/test/compile-fail/no-send-res-ports.rs b/src/test/compile-fail/no-send-res-ports.rs new file mode 100644 index 00000000000..1bbb362db57 --- /dev/null +++ b/src/test/compile-fail/no-send-res-ports.rs @@ -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); + } +}