Skip to content

Commit

Permalink
Attempting to fix Miri
Browse files Browse the repository at this point in the history
  • Loading branch information
olegnn committed Jan 23, 2022
1 parent 12bee98 commit 4091d66
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions futures/tests/stream.rs
@@ -1,3 +1,4 @@
use std::iter;
use std::sync::Arc;

use futures::channel::mpsc;
Expand Down Expand Up @@ -299,13 +300,16 @@ fn flatten_unordered() {

// stream panics
{
let st = once(async { once(async { panic!("Polled") }).boxed() }.boxed()).chain(
let st = stream::iter(iter::once(
once(Box::pin(async { panic!("Polled") })).left_stream::<DataStream>(),
))
.chain(
Interchanger { polled: false, base: 0, wake_immediately: true }
.then(|val| async move { val.boxed() }.boxed())
.map(|stream| stream.right_stream())
.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.flatten_unordered(10)));

std::thread::spawn({
let stream = stream.clone();
Expand Down

0 comments on commit 4091d66

Please sign in to comment.