diff options
| author | Patrick Walton <pcwalton@mimiga.net> | 2013-11-21 23:36:52 -0800 |
|---|---|---|
| committer | Patrick Walton <pcwalton@mimiga.net> | 2013-11-26 08:25:27 -0800 |
| commit | 749ee53c6d23ae1467568d6e0280a4f59e4e952b (patch) | |
| tree | 8ff17ad29a91e3b5d625db08d2d7d9e039ed484a /src/libstd/task | |
| parent | 38efa17bb8b9c1077e7b8cd9d67da08dec3f0bda (diff) | |
| download | rust-749ee53c6d23ae1467568d6e0280a4f59e4e952b.tar.gz rust-749ee53c6d23ae1467568d6e0280a4f59e4e952b.zip | |
librustc: Make `||` lambdas not infer to `proc`s
Diffstat (limited to 'src/libstd/task')
| -rw-r--r-- | src/libstd/task/mod.rs | 10 | ||||
| -rw-r--r-- | src/libstd/task/spawn.rs | 2 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/libstd/task/mod.rs b/src/libstd/task/mod.rs index 189f1436d42..a587515bb16 100644 --- a/src/libstd/task/mod.rs +++ b/src/libstd/task/mod.rs @@ -280,13 +280,13 @@ impl TaskBuilder { let prev_gen_body = match prev_gen_body { Some(gen) => gen, None => { - let f: proc(proc()) -> proc() = |body| body; + let f: proc(proc()) -> proc() = proc(body) body; f } }; let prev_gen_body = Cell::new(prev_gen_body); let next_gen_body = { - let f: proc(proc()) -> proc() = |body| { + let f: proc(proc()) -> proc() = proc(body) { let prev_gen_body = prev_gen_body.take(); wrapper(prev_gen_body(body)) }; @@ -551,7 +551,7 @@ fn test_add_wrapper() { let ch = Cell::new(ch); do b0.add_wrapper |body| { let ch = Cell::new(ch.take()); - let result: proc() = || { + let result: proc() = proc() { let ch = ch.take(); body(); ch.send(()); @@ -765,7 +765,7 @@ fn test_child_doesnt_ref_parent() { // valgrind-friendly. try this at home, instead..!) static generations: uint = 16; fn child_no(x: uint) -> proc() { - return || { + return proc() { if x < generations { let mut t = task(); t.unwatched(); @@ -783,7 +783,7 @@ fn test_simple_newsched_spawn() { use rt::test::run_in_uv_task; do run_in_uv_task { - spawn(||()) + spawn(proc()()) } } diff --git a/src/libstd/task/spawn.rs b/src/libstd/task/spawn.rs index 578839d4542..6c1c28c9805 100644 --- a/src/libstd/task/spawn.rs +++ b/src/libstd/task/spawn.rs @@ -180,7 +180,7 @@ pub fn spawn_raw(mut opts: TaskOpts, f: proc()) { if opts.notify_chan.is_some() { let notify_chan = opts.notify_chan.take_unwrap(); let notify_chan = Cell::new(notify_chan); - let on_exit: proc(UnwindResult) = |task_result| { + let on_exit: proc(UnwindResult) = proc(task_result) { notify_chan.take().send(task_result) }; task.death.on_exit = Some(on_exit); |
