-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Open
Labels
A-async-awaitArea: Async & AwaitArea: Async & AwaitA-impl-traitArea: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch.Area: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch.A-lifetimesArea: Lifetimes / regionsArea: Lifetimes / regionsAsyncAwait-TriagedAsync-await issues that have been triaged during a working group meeting.Async-await issues that have been triaged during a working group meeting.
Description
This compiles:
async fn foo(_: impl Iterator<Item = &u32>) {}
But this doesn't:
fn foo(_: impl Iterator<Item = &u32>) {}
error[E0106]: missing lifetime specifier
--> src/lib.rs:1:32
|
1 | fn foo(_: impl Iterator<Item = &u32>) {}
| ^ expected named lifetime parameter
|
help: consider introducing a named lifetime parameter
|
1 | fn foo<'a>(_: impl Iterator<Item = &'a u32>) {}
| ^^^^ ^^^
This difference strikes me as very odd. Is this intended? If so, why?
This is formulated as a question, but if I had to guess, I would classify this as oversight or bug -- that's why I created an issue instead of askig in the forum.
(originally asked here)
SzilvasiPeter
Metadata
Metadata
Assignees
Labels
A-async-awaitArea: Async & AwaitArea: Async & AwaitA-impl-traitArea: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch.Area: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch.A-lifetimesArea: Lifetimes / regionsArea: Lifetimes / regionsAsyncAwait-TriagedAsync-await issues that have been triaged during a working group meeting.Async-await issues that have been triaged during a working group meeting.
Type
Projects
Status
On deck