diff options
| author | Jeff Olson <olson.jeffery@gmail.com> | 2012-09-07 13:11:03 -0700 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2012-09-08 14:22:16 -0700 |
| commit | 6d84d867360c99a8664118ff44c58c0f838a4cfc (patch) | |
| tree | 820636913fec80dd5f68763c072a379fd5805dbe /src/libcore/future.rs | |
| parent | 2ed00ff9286a26119168e08f25cb33f25d39ef33 (diff) | |
core: change FutureState Forced(A) to Forced(~A)
Diffstat (limited to 'src/libcore/future.rs')
| -rw-r--r-- | src/libcore/future.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libcore/future.rs b/src/libcore/future.rs index 48fad44ff47..99fc9ce4d37 100644 --- a/src/libcore/future.rs +++ b/src/libcore/future.rs @@ -43,7 +43,7 @@ struct Future<A> { priv enum FutureState<A> { Pending(fn~() -> A), Evaluating, - Forced(A) + Forced(~A) } /// Methods on the `future` type @@ -75,7 +75,7 @@ fn from_value<A>(+val: A) -> Future<A> { * not block. */ - Future {state: Forced(val)} + Future {state: Forced(~val)} } fn from_port<A:Send>(+port: future_pipe::client::waiting<A>) -> Future<A> { @@ -139,7 +139,7 @@ fn get_ref<A>(future: &r/Future<A>) -> &r/A { match future.state { Forced(ref v) => { // v here has type &A, but with a shorter lifetime. - return unsafe{ copy_lifetime(future, v) }; // ...extend it. + return unsafe{ copy_lifetime(future, &**v) }; // ...extend it. } Evaluating => { fail ~"Recursive forcing of future!"; @@ -154,7 +154,7 @@ fn get_ref<A>(future: &r/Future<A>) -> &r/A { fail ~"Logic error."; } Pending(move f) => { - future.state = Forced(f()); + future.state = Forced(~f()); return get_ref(future); } } |
