Skip to content

Commit c1197c5

Browse files
olsonjefferybrson
authored andcommitted
---
yaml --- r: 32482 b: refs/heads/dist-snap c: 27129c6 h: refs/heads/master v: v3
1 parent cc27e8e commit c1197c5

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
@@ -7,6 +7,6 @@ refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: d0c6ce338884ee21843f4b40bf6bf18d222ce5df
99
refs/heads/incoming: d9317a174e434d4c99fc1a37fd7dc0d2f5328d37
10-
refs/heads/dist-snap: 6bdda1e0de6097c1647ac49da8b24e86dd5299b8
10+
refs/heads/dist-snap: 27129c6aba153299100887de5c8643cbe3e9b8ef
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/dist-snap/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/dist-snap/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/dist-snap/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)