Skip to content

Commit 6d84d86

Browse files
olsonjefferybrson
authored andcommitted
core: change FutureState Forced(A) to Forced(~A)
1 parent 2ed00ff commit 6d84d86

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/libcore/future.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ struct Future<A> {
4343
priv enum FutureState<A> {
4444
Pending(fn~() -> A),
4545
Evaluating,
46-
Forced(A)
46+
Forced(~A)
4747
}
4848

4949
/// Methods on the `future` type
@@ -75,7 +75,7 @@ fn from_value<A>(+val: A) -> Future<A> {
7575
* not block.
7676
*/
7777

78-
Future {state: Forced(val)}
78+
Future {state: Forced(~val)}
7979
}
8080

8181
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 {
139139

140140
match future.state {
141141
Forced(ref v) => { // v here has type &A, but with a shorter lifetime.
142-
return unsafe{ copy_lifetime(future, v) }; // ...extend it.
142+
return unsafe{ copy_lifetime(future, &**v) }; // ...extend it.
143143
}
144144
Evaluating => {
145145
fail ~"Recursive forcing of future!";
@@ -154,7 +154,7 @@ fn get_ref<A>(future: &r/Future<A>) -> &r/A {
154154
fail ~"Logic error.";
155155
}
156156
Pending(move f) => {
157-
future.state = Forced(f());
157+
future.state = Forced(~f());
158158
return get_ref(future);
159159
}
160160
}

0 commit comments

Comments
 (0)