Skip to content

Commit 4091d66

Browse files
committed
Attempting to fix Miri
1 parent 12bee98 commit 4091d66

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

futures/tests/stream.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
use std::iter;
12
use std::sync::Arc;
23

34
use futures::channel::mpsc;
@@ -299,13 +300,16 @@ fn flatten_unordered() {
299300

300301
// stream panics
301302
{
302-
let st = once(async { once(async { panic!("Polled") }).boxed() }.boxed()).chain(
303+
let st = stream::iter(iter::once(
304+
once(Box::pin(async { panic!("Polled") })).left_stream::<DataStream>(),
305+
))
306+
.chain(
303307
Interchanger { polled: false, base: 0, wake_immediately: true }
304-
.then(|val| async move { val.boxed() }.boxed())
308+
.map(|stream| stream.right_stream())
305309
.take(10),
306310
);
307311

308-
let stream = Arc::new(Mutex::new(st.boxed().flat_map_unordered(10, |s| s.map(identity))));
312+
let stream = Arc::new(Mutex::new(st.flatten_unordered(10)));
309313

310314
std::thread::spawn({
311315
let stream = stream.clone();

0 commit comments

Comments
 (0)