Closed
Description
version 1.49:
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
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Done