Closed
Description
Hi, I have seen this piece of code at alloc/boxed.rs (Futures 0.3.0-alpha.9):
#[unstable(feature = "futures_api", issue = "50547")]
impl<'a, F: Future<Output = ()> + Send + 'a> From<Box<F>> for FutureObj<'a, ()> {
fn from(boxed: Box<F>) -> Self {
FutureObj::new(boxed)
}
}
Full listing here: https://doc.rust-lang.org/src/alloc/boxed.rs.html#833-837
I have a future that returns an output that is not ()
. When I tried to compile:
FutureObj::from(fut.boxed())
I was surprised to find out that ()
is the only Output supported for FutureObj::from
. As a workaround I am using FutureObj::new
. Is this behaviour intentional? I apologize ahead of time if I'm asking something trivial here, I'm still new to this codebase.
Metadata
Metadata
Assignees
Labels
No labels