-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-async-awaitArea: Async & AwaitArea: Async & AwaitA-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsAsyncAwait-TriagedAsync-await issues that have been triaged during a working group meeting.Async-await issues that have been triaged during a working group meeting.D-papercutDiagnostics: An error or lint that needs small tweaks.Diagnostics: An error or lint that needs small tweaks.E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
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
A-async-awaitArea: Async & AwaitArea: Async & AwaitA-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsAsyncAwait-TriagedAsync-await issues that have been triaged during a working group meeting.Async-await issues that have been triaged during a working group meeting.D-papercutDiagnostics: An error or lint that needs small tweaks.Diagnostics: An error or lint that needs small tweaks.E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
Type
Projects
Status
Done