Confusing lifetime inference with a closure #36867
Labels
A-closures
Area: Closures (`|…| { … }`)
A-inference
Area: Type inference
A-lifetimes
Area: Lifetimes / regions
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
The code below compiles and runs as I expect, but when the type annotation is uncommented rustc gives lifetime errors.
I've seen a few similar but not quite the same issues, but I don't think this particular one is already logged (apologies if that's not the case).
Using the trivial function below instead of a closure compiles without errors.
The text was updated successfully, but these errors were encountered: