diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2015-04-01 13:30:51 -0700 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2015-04-01 13:30:51 -0700 |
| commit | 9bb05fd41403c6fc28b82e8eff35f8791876ac18 (patch) | |
| tree | 735ecba6abbc1915e7298dae72cbe034b7cf9d88 /src/libstd/sync | |
| parent | e9bacbaa2c9c88aaecf07ee30f02d08a1999e5c6 (diff) | |
| parent | 8eed73feb659633ef809e2af3399e53d5de6c6fa (diff) | |
| download | rust-9bb05fd41403c6fc28b82e8eff35f8791876ac18.tar.gz rust-9bb05fd41403c6fc28b82e8eff35f8791876ac18.zip | |
rollup merge of #23939: nikomatsakis/fn-box
Conflicts: src/liballoc/boxed.rs
Diffstat (limited to 'src/libstd/sync')
| -rw-r--r-- | src/libstd/sync/future.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/libstd/sync/future.rs b/src/libstd/sync/future.rs index b2afe28fed4..2cdde1aca9e 100644 --- a/src/libstd/sync/future.rs +++ b/src/libstd/sync/future.rs @@ -36,6 +36,7 @@ use core::prelude::*; use core::mem::replace; +use boxed::Box; use self::FutureState::*; use sync::mpsc::{Receiver, channel}; use thunk::Thunk; @@ -84,7 +85,7 @@ impl<A> Future<A> { match replace(&mut self.state, Evaluating) { Forced(_) | Evaluating => panic!("Logic error."), Pending(f) => { - self.state = Forced(f.invoke(())); + self.state = Forced(f()); self.get_ref() } } @@ -114,7 +115,7 @@ impl<A> Future<A> { * function. It is not spawned into another task. */ - Future {state: Pending(Thunk::new(f))} + Future {state: Pending(Box::new(f))} } } |
