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/libextra | |
| parent | 38efa17bb8b9c1077e7b8cd9d67da08dec3f0bda (diff) | |
librustc: Make `||` lambdas not infer to `proc`s
Diffstat (limited to 'src/libextra')
| -rw-r--r-- | src/libextra/future.rs | 6 | ||||
| -rw-r--r-- | src/libextra/task_pool.rs | 6 | ||||
| -rw-r--r-- | src/libextra/test.rs | 14 |
3 files changed, 13 insertions, 13 deletions
diff --git a/src/libextra/future.rs b/src/libextra/future.rs index 8d365c5a520..5fd720c5018 100644 --- a/src/libextra/future.rs +++ b/src/libextra/future.rs @@ -161,7 +161,7 @@ mod test { #[test] fn test_from_fn() { - let mut f = Future::from_fn(|| ~"brail"); + let mut f = Future::from_fn(proc() ~"brail"); assert_eq!(f.get(), ~"brail"); } @@ -185,14 +185,14 @@ mod test { #[test] fn test_spawn() { - let mut f = Future::spawn(|| ~"bale"); + let mut f = Future::spawn(proc() ~"bale"); assert_eq!(f.get(), ~"bale"); } #[test] #[should_fail] fn test_futurefail() { - let mut f = Future::spawn(|| fail!()); + let mut f = Future::spawn(proc() fail!()); let _x: ~str = f.get(); } diff --git a/src/libextra/task_pool.rs b/src/libextra/task_pool.rs index d6eed24ef8d..bda6935643f 100644 --- a/src/libextra/task_pool.rs +++ b/src/libextra/task_pool.rs @@ -57,7 +57,7 @@ impl<T> TaskPool<T> { let (port, chan) = comm::stream::<Msg<T>>(); let init_fn = init_fn_factory(); - let task_body: proc() = || { + let task_body: proc() = proc() { let local_data = init_fn(i); loop { match port.recv() { @@ -98,11 +98,11 @@ impl<T> TaskPool<T> { #[test] fn test_task_pool() { let f: || -> proc(uint) -> uint = || { - let g: proc(uint) -> uint = |i| i; + let g: proc(uint) -> uint = proc(i) i; g }; let mut pool = TaskPool::new(4, Some(SingleThreaded), f); 8.times(|| { - pool.execute(|i| println!("Hello from thread {}!", *i)); + pool.execute(proc(i) println!("Hello from thread {}!", *i)); }) } diff --git a/src/libextra/test.rs b/src/libextra/test.rs index c94cb196bea..16e9ea8ece4 100644 --- a/src/libextra/test.rs +++ b/src/libextra/test.rs @@ -912,7 +912,7 @@ pub fn run_test(force_ignore: bool, return; } DynTestFn(f) => run_test_inner(desc, monitor_ch, f), - StaticTestFn(f) => run_test_inner(desc, monitor_ch, || f()) + StaticTestFn(f) => run_test_inner(desc, monitor_ch, proc() f()) } } @@ -1209,7 +1209,7 @@ mod tests { ignore: true, should_fail: false }, - testfn: DynTestFn(|| f()), + testfn: DynTestFn(proc() f()), }; let (p, ch) = stream(); let ch = SharedChan::new(ch); @@ -1227,7 +1227,7 @@ mod tests { ignore: true, should_fail: false }, - testfn: DynTestFn(|| f()), + testfn: DynTestFn(proc() f()), }; let (p, ch) = stream(); let ch = SharedChan::new(ch); @@ -1245,7 +1245,7 @@ mod tests { ignore: false, should_fail: true }, - testfn: DynTestFn(|| f()), + testfn: DynTestFn(proc() f()), }; let (p, ch) = stream(); let ch = SharedChan::new(ch); @@ -1263,7 +1263,7 @@ mod tests { ignore: false, should_fail: true }, - testfn: DynTestFn(|| f()), + testfn: DynTestFn(proc() f()), }; let (p, ch) = stream(); let ch = SharedChan::new(ch); @@ -1318,7 +1318,7 @@ mod tests { ignore: true, should_fail: false, }, - testfn: DynTestFn(|| {}), + testfn: DynTestFn(proc() {}), }, TestDescAndFn { desc: TestDesc { @@ -1326,7 +1326,7 @@ mod tests { ignore: false, should_fail: false }, - testfn: DynTestFn(|| {}), + testfn: DynTestFn(proc() {}), }, ]; let filtered = filter_tests(&opts, tests); |
