version 1.49:
https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=6cf5c01427a274fed3395916ea86ab87
FuturesUnordered requires futures with the same type:
use futures::stream::FuturesUnordered;
fn main() {
let u = FuturesUnordered::new();
u.push(async {});
u.push(async {});
}
results in:
error[E0308]: mismatched types
--> src/main.rs:12:18
|
11 | u.push(async {});
| -- the expected generator
12 | u.push(async {});
| ^^ expected generator, found a different generator
|
= note: expected generator `[static generator@src/main.rs:11:18: 11:20]`
found generator `[static generator@src/main.rs:12:18: 12:20]`
As far as I know, generators have 2 types in their internal representation, so their display impl (its not actually display as far as I remember, but whatever creates the string to describe a type), should me more accurate about it being a future
also, these spans seem off?
@rustbot label +A-async-await +A-diagnostics +D-papercut
version 1.49:
https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=6cf5c01427a274fed3395916ea86ab87
FuturesUnorderedrequires futures with the same type:results in:
As far as I know, generators have 2 types in their internal representation, so their display impl (its not actually display as far as I remember, but whatever creates the string to describe a type), should me more accurate about it being a future
also, these spans seem off?
@rustbot label +A-async-await +A-diagnostics +D-papercut