Implicit lifetimes of type parameters does not work #75252
Labels
A-implied-bounds
Area: Implied bounds / inferred outlives-bounds
C-bug
Category: This is a bug.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
T-types
Relevant to the types team, which will review and decide on the PR/issue.
This code should work:
(Playground)
Because, even though we don't assign
'a
lifetime toK
andV
, since we have&'a K
&'a V
in the signature, that lifetime should be implicitly assigned to them instead. Currently that does not compile and we get this error below:Despite the example, this doesn't seem like a problem for
IntoIterator
only. It looks like there is a fundamental problem instead. This was separated from the example in #74034 and thanks @nbdd0121 for pointing that out in #75203.Meta
rustc --version --verbose
:The text was updated successfully, but these errors were encountered: