You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ rustup run nightly cargo run
Compiling wut v0.1.0 (file:///home/alex/code/wut)
error[E0277]: the trait bound `futures::stream::Stream<Item=(futures_mio::TcpStream, std::net::SocketAddr), Error=std::io::Error>: std::marker::Sized` is not satisfied
--> src/main.rs:24:32
|
24 | let welcomes = clients.and_then(|(socket, _peer_addr)| {
| ^^^^^^^^
|
= note: `futures::stream::Stream<Item=(futures_mio::TcpStream, std::net::SocketAddr), Error=std::io::Error>` does not have a constant size known at compile-time
error: no method named `fold` found for type `futures::stream::AndThen<futures::stream::Stream<Item=(futures_mio::TcpStream, std::net::SocketAddr), Error=std::io::Error>, [closure@src/main.rs:24:41: 26:10], futures_io::WriteAll<futures_mio::TcpStream, &[u8; 29]>>` in the current scope
--> src/main.rs:27:18
|
27 | welcomes.fold((), |(), (socket, _welcome)| {
| ^^^^
|
= note: the method `fold` exists but the following trait bounds were not satisfied: `futures::stream::AndThen<futures::stream::Stream<Item=(futures_mio::TcpStream, std::net::SocketAddr), Error=std::io::Error>, [closure@src/main.rs:24:41: 26:10], futures_io::WriteAll<futures_mio::TcpStream, &[u8; 29]>> : std::iter::Iterator`
error: aborting due to 2 previous errors
error: Could not compile `wut`.
To learn more, run the command again with --verbose.
The real error here is that I forgot to import the Stream trait, but instead I'm seeing a few points which confused me:
Talking about Sized is mega-confusing as it's not really related.
Printing the full type here ends up being somewhat harmful
At the end it's talking about Iterator, but that's unrelated in this case
This gist contains all the code, the relevant file being this one.
When compiling, I get:
The real error here is that I forgot to import the
Stream
trait, but instead I'm seeing a few points which confused me:Sized
is mega-confusing as it's not really related.Iterator
, but that's unrelated in this casecc @jonathandturner
cc @nikomatsakis
The text was updated successfully, but these errors were encountered: