@@ -34,14 +34,16 @@ pub trait SpawnExt: Spawn {
34
34
/// today. Feel free to use this method in the meantime.
35
35
///
36
36
/// ```
37
- /// # if cfg!(miri) { return; } // https://github.com/rust-lang/miri/issues/1038
37
+ /// # {
38
38
/// use futures::executor::ThreadPool;
39
39
/// use futures::task::SpawnExt;
40
40
///
41
41
/// let executor = ThreadPool::new().unwrap();
42
42
///
43
43
/// let future = async { /* ... */ };
44
44
/// executor.spawn(future).unwrap();
45
+ /// # }
46
+ /// # std::thread::sleep(std::time::Duration::from_secs(1)); // wait for background threads closed
45
47
/// ```
46
48
#[ cfg( feature = "alloc" ) ]
47
49
fn spawn < Fut > ( & self , future : Fut ) -> Result < ( ) , SpawnError >
@@ -59,7 +61,7 @@ pub trait SpawnExt: Spawn {
59
61
/// resolves to the output of the spawned future.
60
62
///
61
63
/// ```
62
- /// # if cfg!(miri) { return; } // https://github.com/rust-lang/miri/issues/1038
64
+ /// # {
63
65
/// use futures::executor::{block_on, ThreadPool};
64
66
/// use futures::future;
65
67
/// use futures::task::SpawnExt;
@@ -69,6 +71,8 @@ pub trait SpawnExt: Spawn {
69
71
/// let future = future::ready(1);
70
72
/// let join_handle_fut = executor.spawn_with_handle(future).unwrap();
71
73
/// assert_eq!(block_on(join_handle_fut), 1);
74
+ /// # }
75
+ /// # std::thread::sleep(std::time::Duration::from_secs(1)); // wait for background threads closed
72
76
/// ```
73
77
#[ cfg( feature = "channel" ) ]
74
78
#[ cfg_attr( docsrs, doc( cfg( feature = "channel" ) ) ) ]
@@ -138,7 +142,6 @@ pub trait LocalSpawnExt: LocalSpawn {
138
142
/// resolves to the output of the spawned future.
139
143
///
140
144
/// ```
141
- /// # if cfg!(miri) { return; } // https://github.com/rust-lang/miri/issues/1038
142
145
/// use futures::executor::LocalPool;
143
146
/// use futures::task::LocalSpawnExt;
144
147
///
0 commit comments