Open
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)
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
On deck