diff --git a/futures/tests/stream.rs b/futures/tests/stream.rs index 48a86b950e..231b0c1790 100644 --- a/futures/tests/stream.rs +++ b/futures/tests/stream.rs @@ -299,13 +299,14 @@ fn flatten_unordered() { // stream panics { - let st = once(async { once(async { panic!("Polled") }).boxed() }.boxed()).chain( - Interchanger { polled: false, base: 0, wake_immediately: true } - .then(|val| async move { val.boxed() }.boxed()) - .take(10), - ); + let st = once(async { once(Box::pin(async { panic!("Polled") })).left_stream() }.boxed()) + .chain( + Interchanger { polled: false, base: 0, wake_immediately: true } + .then(|val| async move { val.right_stream() }.boxed()) + .take(10), + ); - let stream = Arc::new(Mutex::new(st.boxed().flat_map_unordered(10, |s| s.map(identity)))); + let stream = Arc::new(Mutex::new(st.flat_map_unordered(10, |s| s.map(identity)))); std::thread::spawn({ let stream = stream.clone();