diff options
Diffstat (limited to 'vendor/futures-util/src/task')
-rw-r--r-- | vendor/futures-util/src/task/spawn.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/vendor/futures-util/src/task/spawn.rs b/vendor/futures-util/src/task/spawn.rs index f8779230e..d9e998530 100644 --- a/vendor/futures-util/src/task/spawn.rs +++ b/vendor/futures-util/src/task/spawn.rs @@ -34,6 +34,7 @@ pub trait SpawnExt: Spawn { /// today. Feel free to use this method in the meantime. /// /// ``` + /// # { /// use futures::executor::ThreadPool; /// use futures::task::SpawnExt; /// @@ -41,6 +42,8 @@ pub trait SpawnExt: Spawn { /// /// let future = async { /* ... */ }; /// executor.spawn(future).unwrap(); + /// # } + /// # std::thread::sleep(std::time::Duration::from_millis(500)); // wait for background threads closed: https://github.com/rust-lang/miri/issues/1371 /// ``` #[cfg(feature = "alloc")] fn spawn<Fut>(&self, future: Fut) -> Result<(), SpawnError> @@ -58,6 +61,7 @@ pub trait SpawnExt: Spawn { /// resolves to the output of the spawned future. /// /// ``` + /// # { /// use futures::executor::{block_on, ThreadPool}; /// use futures::future; /// use futures::task::SpawnExt; @@ -67,6 +71,8 @@ pub trait SpawnExt: Spawn { /// let future = future::ready(1); /// let join_handle_fut = executor.spawn_with_handle(future).unwrap(); /// assert_eq!(block_on(join_handle_fut), 1); + /// # } + /// # std::thread::sleep(std::time::Duration::from_millis(500)); // wait for background threads closed: https://github.com/rust-lang/miri/issues/1371 /// ``` #[cfg(feature = "channel")] #[cfg_attr(docsrs, doc(cfg(feature = "channel")))] |