Hey folks,
I've ran a snippet from here in the playground and the error says:
(...) ioo
is a reference that is only valid in the function body (...)
This confuses me because it looks to me as if an owned value gets moved into the function and not a reference.
Could somebody explain why the compiler is talking here about a reference?
Regards
keks
The error should say "value" or something, not reference.
In practically all non-'static
lifetimes arise because of a non-'static
reference existing somewhere, which leads to loose language conflating lifetimes with references. But it is also possible to pull them out of trait implementations or via covariance on non-references such as a trait object, etc.
2 Likes