[SOLVED] Unsized issues and Futures


I’m currently getting a unsized error on this line:

this message:

src/udp/udp_client_stream.rs:40:12: 40:16 error: the trait bound futures::Future<Error=std::io::Error, Item=tokio_core::UdpSocket> + Send + 'static: std::marker::Sized is not satisfied [E0277]
src/udp/udp_client_stream.rs:40 socket.join(outbound_messages).and_then(move |(socket, rx)| {
src/udp/udp_client_stream.rs:40:12: 40:16 help: run rustc --explain E0277 to see a detailed explanation
src/udp/udp_client_stream.rs:40:12: 40:16 note: futures::Future<Error=std::io::Error, Item=tokio_core::UdpSocket> + Send + 'static does not have a constant size known at compile-time

I can’t for the life of me see the exact issue, Vec is sized, right? I tried switching to Box<[u8]>, but that didn’t resolve the issue.

@alexcrichton moved the convo here for broader audience.


Ah yeah this is unfortunate I believe is a bug in the compiler, but the core issue is that you’ll need to import either the Future or Stream trait.


Ah, ok. I’m importing Stream here:


but not Future. I will try that.


ok, including Future explicitly resolved that issue. Now I have some others, but get to move on from that confusion. thanks.