@@ -34,14 +34,16 @@ pub trait SpawnExt: Spawn {
3434 /// today. Feel free to use this method in the meantime.
3535 ///
3636 /// ```
37- /// # if cfg!(miri) { return; } // https://github.com/rust-lang/miri/issues/1038
37+ /// # {
3838 /// use futures::executor::ThreadPool;
3939 /// use futures::task::SpawnExt;
4040 ///
4141 /// let executor = ThreadPool::new().unwrap();
4242 ///
4343 /// let future = async { /* ... */ };
4444 /// executor.spawn(future).unwrap();
45+ /// # }
46+ /// # std::thread::sleep(std::time::Duration::from_secs(1)); // wait for background threads closed
4547 /// ```
4648 #[ cfg( feature = "alloc" ) ]
4749 fn spawn < Fut > ( & self , future : Fut ) -> Result < ( ) , SpawnError >
@@ -59,7 +61,7 @@ pub trait SpawnExt: Spawn {
5961 /// resolves to the output of the spawned future.
6062 ///
6163 /// ```
62- /// # if cfg!(miri) { return; } // https://github.com/rust-lang/miri/issues/1038
64+ /// # {
6365 /// use futures::executor::{block_on, ThreadPool};
6466 /// use futures::future;
6567 /// use futures::task::SpawnExt;
@@ -69,6 +71,8 @@ pub trait SpawnExt: Spawn {
6971 /// let future = future::ready(1);
7072 /// let join_handle_fut = executor.spawn_with_handle(future).unwrap();
7173 /// assert_eq!(block_on(join_handle_fut), 1);
74+ /// # }
75+ /// # std::thread::sleep(std::time::Duration::from_secs(1)); // wait for background threads closed
7276 /// ```
7377 #[ cfg( feature = "channel" ) ]
7478 #[ cfg_attr( docsrs, doc( cfg( feature = "channel" ) ) ) ]
@@ -138,7 +142,6 @@ pub trait LocalSpawnExt: LocalSpawn {
138142 /// resolves to the output of the spawned future.
139143 ///
140144 /// ```
141- /// # if cfg!(miri) { return; } // https://github.com/rust-lang/miri/issues/1038
142145 /// use futures::executor::LocalPool;
143146 /// use futures::task::LocalSpawnExt;
144147 ///
0 commit comments