mirror of https://github.com/smol-rs/async-task
docs: Clarify safety docs for `spawn_unchecked`
* docs(safety): Clarify safety requirements for spawn_unchecked * docs(safety): Clarify free spawn_unchecked function safety reqs
This commit is contained in:
parent
d598dc8026
commit
182c4ddfe2
|
@ -476,12 +476,13 @@ impl<M> Builder<M> {
|
|||
///
|
||||
/// # Safety
|
||||
///
|
||||
/// - If `future`'s output is not [`Send`], its [`Runnable`] must be used and dropped on the original
|
||||
/// - If `Fut` is not [`Send`], its [`Runnable`] must be used and dropped on the original
|
||||
/// thread.
|
||||
/// - If `future`'s output is not `'static`, borrowed variables must outlive its [`Runnable`].
|
||||
/// - If `schedule` is not [`Send`] and [`Sync`], the task's [`Waker`] must be used and dropped on
|
||||
/// the original thread.
|
||||
/// - If `schedule` is not `'static`, borrowed variables must outlive the task's [`Waker`].
|
||||
/// - If `Fut` is not `'static`, borrowed non-metadata variables must outlive its [`Runnable`].
|
||||
/// - If `schedule` is not [`Send`] and [`Sync`], all instances of the [`Runnable`]'s [`Waker`]
|
||||
/// must be used and dropped on the original thread.
|
||||
/// - If `schedule` is not `'static`, borrowed variables must outlive all instances of the
|
||||
/// [`Runnable`]'s [`Waker`].
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
|
@ -627,9 +628,10 @@ where
|
|||
/// - If `future` is not [`Send`], its [`Runnable`] must be used and dropped on the original
|
||||
/// thread.
|
||||
/// - If `future` is not `'static`, borrowed variables must outlive its [`Runnable`].
|
||||
/// - If `schedule` is not [`Send`] and [`Sync`], the task's [`Waker`] must be used and dropped on
|
||||
/// the original thread.
|
||||
/// - If `schedule` is not `'static`, borrowed variables must outlive the task's [`Waker`].
|
||||
/// - If `schedule` is not [`Send`] and [`Sync`], all instances of the [`Runnable`]'s [`Waker`]
|
||||
/// must be used and dropped on the original thread.
|
||||
/// - If `schedule` is not `'static`, borrowed variables must outlive all instances of the
|
||||
/// [`Runnable`]'s [`Waker`].
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
|
|
Loading…
Reference in New Issue