Skip to content

Commit 5158fd1

Browse files
olsonjefferybrson
authored andcommitted
---
yaml --- r: 28398 b: refs/heads/try c: 27129c6 h: refs/heads/master v: v3
1 parent c8248b1 commit 5158fd1

File tree

4 files changed

+18
-9
lines changed

4 files changed

+18
-9
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: cd6f24f9d14ac90d167386a56e7a6ac1f0318195
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: cd6f24f9d14ac90d167386a56e7a6ac1f0318195
5-
refs/heads/try: 6bdda1e0de6097c1647ac49da8b24e86dd5299b8
5+
refs/heads/try: 27129c6aba153299100887de5c8643cbe3e9b8ef
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: d0c6ce338884ee21843f4b40bf6bf18d222ce5df

branches/try/src/libcore/future.rs

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ struct Future<A> {
3737
}
3838

3939
priv enum FutureState<A> {
40-
Pending(fn@() -> A),
40+
Pending(fn~() -> A),
4141
Evaluating,
4242
Forced(A)
4343
}
@@ -93,7 +93,7 @@ fn from_port<A:Send>(+port: future_pipe::client::waiting<A>) -> Future<A> {
9393
}
9494
}
9595

96-
fn from_fn<A>(+f: @fn() -> A) -> Future<A> {
96+
fn from_fn<A>(+f: ~fn() -> A) -> Future<A> {
9797
/*!
9898
* Create a future from a function.
9999
*
@@ -239,4 +239,14 @@ mod test {
239239
let f = spawn(|| fail);
240240
let _x: ~str = get(&f);
241241
}
242-
}
242+
243+
#[test]
244+
fn test_sendable_future() {
245+
let expected = ~"schlorf";
246+
let f = do spawn |copy expected| { expected };
247+
do task::spawn {
248+
let actual = get(&f);
249+
assert actual == expected;
250+
}
251+
}
252+
}

branches/try/src/libcore/task.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1754,7 +1754,7 @@ fn test_spawn_linked_sup_fail_down() { // parent fails; child fails
17541754
opts.supervised = true;
17551755
move opts
17561756
};
1757-
1757+
17581758
let b0 = task();
17591759
let b1 = TaskBuilder({
17601760
opts: move opts,

branches/try/src/rustdoc/markdown_writer.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -285,15 +285,14 @@ fn future_writer_factory(
285285
}
286286
287287
fn future_writer() -> (writer, future::Future<~str>) {
288-
let port = comm::Port();
289-
let chan = comm::Chan(port);
288+
let (chan, port) = pipes::stream();
290289
let writer = fn~(+instr: writeinstr) {
291-
comm::send(chan, copy instr);
290+
chan.send(copy instr);
292291
};
293292
let future = do future::from_fn {
294293
let mut res = ~"";
295294
loop {
296-
match comm::recv(port) {
295+
match port.recv() {
297296
write(s) => res += s,
298297
done => break
299298
}

0 commit comments

Comments
 (0)