Error code E0495
Note: this error code is no longer emitted by the compiler.
A lifetime cannot be determined in the given situation.
Erroneous code example:
ⓘ
In this code, you have two ways to solve this issue:
- Enforce that
'a
lives at least as long as'b
. - Use the same lifetime requirement for both input and output values.
So for the first solution, you can do it by replacing 'a
with 'a: 'b
:
In the second you can do it by simply removing 'b
so they both use 'a
: