Lifetime inference fails for closures returning references to their parameters #125124
Labels
A-closures
Area: Closures (`|…| { … }`)
A-lifetimes
Area: Lifetimes / regions
C-bug
Category: This is a bug.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
I tried this code:
I expected to see this happen: code compiles
Instead, this happened:
This workaround involves defining a helper function just to handle the lifetimes explicitly, which complicates the code unnecessarily. It feels like a cumbersome solution to what should be a simpler problem.
full example
The text was updated successfully, but these errors were encountered: