···11+mod maybe_done;
22+33+use futures_core::ScopedFuture;
44+pub use maybe_done::*;
55+66+// Just a helper function to ensure the futures we're returning all have the
77+// right implementations.
88+pub(crate) fn assert_future<'scope, T, F>(future: F) -> F
99+where
1010+ F: ScopedFuture<'scope, Output = T>,
1111+{
1212+ future
1313+}
···3636/// what occurs in `core::task::Future::poll()` is that the ref to a cx.waker
3737/// is cloned and stored by a reactor via some method.
3838///
3939-///
4039/// The waker is no longer tied to the actual future's lifetime, making it
4140/// unsound to not have either static tasks or reference counting.
4241/// To avoid this, we want to use a &'scope waker instead, with 1 waker / task.
4343-///
4444-/// If waker is ownable/cloneable, that erases the lifetime's importance.
4545-/// If the waker is a non clonable mutable reference that lives for 'scope,
4646-/// it cannot be passed into `poll` every time the future is polled, instead it
4747-/// must only be registered once, leading to a register_waker api that is very
4848-/// cumbersome without unsafe poll/unsafe register_waker. Instead, it's easier
4949-/// to use a non clonable immutable reference and have waking occur via
5050-/// interior mutability (this is fine since combinators rely on interior
5151-/// mutability anyway for a 1 parent : many children waker relationship)
5242pub trait ScopedFuture<'scope> {
5343 type Output;
5444