diff options
| author | Niko Matsakis <niko@alum.mit.edu> | 2013-04-17 18:05:17 -0400 |
|---|---|---|
| committer | Niko Matsakis <niko@alum.mit.edu> | 2013-04-30 06:43:02 -0400 |
| commit | 202b8dcdc420d8b109fbd5260ea2e2be0a5b7faf (patch) | |
| tree | e83d223715ffe4b842f3a46b274b31ee3655ec50 /src/libstd/future.rs | |
| parent | c081ffbd1e845687202a975ea2e698b623e5722f (diff) | |
| download | rust-202b8dcdc420d8b109fbd5260ea2e2be0a5b7faf.tar.gz rust-202b8dcdc420d8b109fbd5260ea2e2be0a5b7faf.zip | |
adapt to snapshot
Diffstat (limited to 'src/libstd/future.rs')
| -rw-r--r-- | src/libstd/future.rs | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/src/libstd/future.rs b/src/libstd/future.rs index f59abfa81ca..c3fc16bdf70 100644 --- a/src/libstd/future.rs +++ b/src/libstd/future.rs @@ -54,35 +54,6 @@ pub impl<A:Copy> Future<A> { } pub impl<A> Future<A> { - #[cfg(stage0)] - fn get_ref(&self) -> &'self A { - /*! - * Executes the future's closure and then returns a borrowed - * pointer to the result. The borrowed pointer lasts as long as - * the future. - */ - unsafe { - match self.state { - Forced(ref mut v) => { return cast::transmute(v); } - Evaluating => fail!(~"Recursive forcing of future!"), - Pending(_) => {} - } - - let mut state = Evaluating; - self.state <-> state; - match state { - Forced(_) | Evaluating => fail!(~"Logic error."), - Pending(f) => { - self.state = Forced(f()); - self.get_ref() - } - } - } - } - - #[cfg(stage1)] - #[cfg(stage2)] - #[cfg(stage3)] fn get_ref<'a>(&'a self) -> &'a A { /*! * Executes the future's closure and then returns a borrowed |
