Skip to content

Commit

Permalink
sidestep monomorphization error
Browse files Browse the repository at this point in the history
  • Loading branch information
David Renshaw committed Jan 20, 2017
1 parent 434825a commit da6e69c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/stresstest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ fn initialize_subscribers(
{
// Box these things to avoid the weird error:
// `error: reached the recursion limit during monomorphization (selection ambiguity)`
let mut subscriber_read_tasks: Vec<Box<Future<Item=u64,Error=::std::io::Error> + Send>> = Vec::new();
let mut subscriber_read_tasks = Vec::new();

let mut subscriber_senders: Option<Box<Future<Item=Vec<::futures::sync::mpsc::UnboundedSender<ChannelElem>>,
Error=::std::io::Error> + Send>> =
Expand All @@ -270,7 +270,7 @@ fn initialize_subscribers(
::std::io::Error::new(::std::io::ErrorKind::Other,"canceled")
})));

subscriber_read_tasks.push(Box::new(TcpStream::connect(addr, handle).and_then(move |socket| {
subscriber_read_tasks.push(TcpStream::connect(addr, handle).and_then(move |socket| {
subscriber_senders1.and_then(move |mut subscriber_senders| {
use tokio_core::io::Io;
let (reader, writer) = socket.split();
Expand Down Expand Up @@ -308,9 +308,9 @@ fn initialize_subscribers(
})
});

read_task.join(sender_init)
}).map(|(n, _)| n)
})));
read_task.join(sender_init).map(|(n, _)| n)
})
}));
}

let read_tasks = future::join_all(subscriber_read_tasks).and_then(move |read_values| {
Expand Down

0 comments on commit da6e69c

Please sign in to comment.