Skip to content

Commit 788f7a6

Browse files
committed
---
yaml --- r: 12929 b: refs/heads/master c: 0b2f2ca h: refs/heads/master i: 12927: bc1d0bb v: v3
1 parent d7d951a commit 788f7a6

File tree

11 files changed

+44
-49
lines changed

11 files changed

+44
-49
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: f213c1f3a817ba2c0a43c0b27215146b7a279f65
2+
refs/heads/master: 0b2f2cabbe3fbe6e18cbf0f8a174b7d4789fc938
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
55
refs/heads/try: 2898dcc5d97da9427ac367542382b6239d9c0bbf

trunk/src/libcore/future.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ enum future<A> = {
2828
};
2929

3030
#[doc = "Methods on the `future` type"]
31-
impl future<A:send> for future<A> {
31+
impl future<A:copy send> for future<A> {
3232

3333
fn get() -> A {
3434
#[doc = "Get the value of the future"];

trunk/src/libstd/timer.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ for *at least* that period of time.
2020
* ch - a channel of type T to send a `val` on
2121
* val - a value of type T to send over the provided `ch`
2222
"]
23-
fn delayed_send<T: send>(msecs: uint, ch: comm::chan<T>, val: T) {
23+
fn delayed_send<T: copy send>(msecs: uint, ch: comm::chan<T>, val: T) {
2424
task::spawn() {||
2525
unsafe {
2626
let timer_done_po = comm::port::<()>();
@@ -94,7 +94,9 @@ An `option<T>` representing the outcome of the call. If the call `recv`'d on
9494
the provided port in the allotted timeout period, then the result will be a
9595
`some(T)`. If not, then `none` will be returned.
9696
"]
97-
fn recv_timeout<T: send>(msecs: uint, wait_po: comm::port<T>) -> option<T> {
97+
fn recv_timeout<T: copy send>(msecs: uint, wait_po: comm::port<T>)
98+
-> option<T> {
99+
98100
let timeout_po = comm::port::<()>();
99101
let timeout_ch = comm::chan(timeout_po);
100102
delayed_send(msecs, timeout_ch, ());

trunk/src/rustc/middle/kind.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,12 @@ import freevars::freevar_entry;
2424
// types.
2525

2626
fn kind_to_str(k: kind) -> str {
27-
if k == kind_sendable() { "sendable" }
28-
else if k == kind_copyable() { "copyable" }
29-
else if k == kind_noncopyable() { "noncopyable" }
30-
else { fail "unknown kind" }
27+
alt (ty::kind_can_be_copied(k), ty::kind_can_be_sent(k)) {
28+
(false, false) { "noncopyable" }
29+
(false, true) { "sendable" }
30+
(true, false) { "copyable" }
31+
(true, true) { "copy-sendable" }
32+
}
3133
}
3234

3335
type rval_map = std::map::hashmap<node_id, ()>;

trunk/src/rustc/middle/ty.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -425,9 +425,9 @@ fn param_bounds_to_kind(bounds: param_bounds) -> kind {
425425
for vec::each(*bounds) {|bound|
426426
alt bound {
427427
bound_copy {
428-
if kind != kind_sendable() { kind = kind_copyable(); }
428+
kind = lower_kind(kind, kind_copyable());
429429
}
430-
bound_send { kind = kind_sendable(); }
430+
bound_send { kind = lower_kind(kind, kind_send_only()); }
431431
_ {}
432432
}
433433
}
@@ -1277,6 +1277,10 @@ fn kind_sendable() -> kind {
12771277
kind_(KIND_MASK_COPY | KIND_MASK_SEND)
12781278
}
12791279

1280+
fn kind_send_only() -> kind {
1281+
kind_(KIND_MASK_SEND)
1282+
}
1283+
12801284
// Using these query functons is preferable to direct comparison or matching
12811285
// against the kind constants, as we may modify the kind hierarchy in the
12821286
// future.
@@ -1303,7 +1307,7 @@ fn kind_lteq(a: kind, b: kind) -> bool {
13031307
}
13041308

13051309
fn lower_kind(a: kind, b: kind) -> kind {
1306-
if kind_lteq(a, b) { a } else { b }
1310+
kind_(*a | *b)
13071311
}
13081312

13091313
#[test]
@@ -1402,7 +1406,7 @@ fn type_kind(cx: ctxt, ty: t) -> kind {
14021406
}
14031407
lowest
14041408
}
1405-
ty_res(did, inner, tps) { kind_noncopyable() }
1409+
ty_res(did, inner, tps) { kind_send_only() }
14061410
ty_param(_, did) {
14071411
param_bounds_to_kind(cx.ty_param_bounds.get(did.node))
14081412
}

trunk/src/rustdoc/fold.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ fn mk_fold<T:copy>(
8585
})
8686
}
8787

88-
fn default_any_fold<T:send>(ctxt: T) -> fold<T> {
88+
fn default_any_fold<T:send copy>(ctxt: T) -> fold<T> {
8989
mk_fold(
9090
ctxt,
9191
{|f, d| default_seq_fold_doc(f, d)},
@@ -121,7 +121,7 @@ fn default_seq_fold<T:copy>(ctxt: T) -> fold<T> {
121121
)
122122
}
123123

124-
fn default_par_fold<T:send>(ctxt: T) -> fold<T> {
124+
fn default_par_fold<T:send copy>(ctxt: T) -> fold<T> {
125125
mk_fold(
126126
ctxt,
127127
{|f, d| default_seq_fold_doc(f, d)},

trunk/src/test/compile-fail/kindck-nonsendable-2.rs

Lines changed: 0 additions & 17 deletions
This file was deleted.

trunk/src/test/compile-fail/pinned-deep-copy.rs

Lines changed: 0 additions & 16 deletions
This file was deleted.

trunk/src/test/run-pass/alignment-gep-tup-like-2.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ fn make_cycle<A:copy>(a: A) {
1313
g.rec = some(g);
1414
}
1515

16-
fn f<A:send,B:send>(a: A, b: B) -> fn@() -> (A, B) {
16+
fn f<A:send copy, B:send copy>(a: A, b: B) -> fn@() -> (A, B) {
1717
fn@() -> (A, B) { (a, b) }
1818
}
1919

trunk/src/test/run-pass/generic-alias-unique.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22

3-
fn id<T: send>(t: T) -> T { ret t; }
3+
fn id<T: copy send>(t: T) -> T { ret t; }
44

55
fn main() {
66
let expected = ~100;
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import task::*;
2+
import comm::*;
3+
4+
resource test(_f: int) {
5+
// Do nothing
6+
}
7+
8+
fn main() {
9+
let p = port();
10+
let c = chan(p);
11+
12+
spawn() {||
13+
let p = port();
14+
c.send(chan(p));
15+
16+
let _r = p.recv();
17+
}
18+
19+
p.recv().send(test(42));
20+
}

0 commit comments

Comments
 (0)