Skip to content

Commit b793cf8

Browse files
author
Without Boats
committed
Simplify GenFuture API.
1 parent 09b066c commit b793cf8

File tree

1 file changed

+1
-15
lines changed

1 file changed

+1
-15
lines changed

src/libcore/raw.rs

+1-15
Original file line numberDiff line numberDiff line change
@@ -104,21 +104,7 @@ pub struct TraitObject {
104104
/// depend on it.
105105
#[allow(missing_debug_implementations, dead_code)]
106106
#[unstable(feature = "gen_future", issue = "50547")]
107-
pub struct GenFuture<G, R> {
108-
gen: G,
109-
marker: ::marker::PhantomData<R>,
110-
}
111-
112-
/// Construct a future from a generator (used in lowering async functions).
113-
///
114-
/// This is a permanently unstable API used by the compiler. You should not
115-
/// depend on it.
116-
#[unstable(feature = "gen_future", issue = "50547")]
117-
pub fn gen_future<G>(gen: G) -> GenFuture<G, G::Return> where
118-
G: ::ops::Generator<Yield = ()>
119-
{
120-
GenFuture { gen, marker: ::marker::PhantomData }
121-
}
107+
pub struct GenFuture<G: ::ops::Generator<Yield = (), Return = R>, R>(pub G);
122108

123109
#[unstable(feature = "gen_future", issue = "50547")]
124110
impl<G> ::future::Future for GenFuture<G, G::Return> where

0 commit comments

Comments
 (0)