diff --git a/src/lib.rs b/src/lib.rs index 3f0bb8b..59681da 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -143,6 +143,15 @@ impl<'a, T, const STACK_SIZE: usize> StackFuture<'a, T, { STACK_SIZE }> { where F: Future + Send + 'a, // the bounds here should match those in the _phantom field { + // Ideally we would provide this as: + // + // impl<'a, F, const STACK_SIZE: usize> From for StackFuture<'a, F::Output, { STACK_SIZE }> + // where + // F: Future + Send + 'a + // + // However, libcore provides a blanket `impl From for T`, and since `StackFuture: Future`, + // both impls end up being applicable to do `From for StackFuture`. + Self::try_from(future).unwrap_or_else(|f| { match (Self::has_alignment_for_val(&f), Self::has_space_for_val(&f)) { (false, false) => panic!(