Why does Rust require explicit lifetimes annotations when it seems like it already knows where they should be used?
This is one thing about lifetimes that I just haven't quite been able to reconcile in my head.
I understand that explicit lifetimes are used to help the compiler, but I don't understand that given that being the case, how it's also supposedly impossible to annotate things incorrectly, implying that the compiler already knows where they need to go, and so why were the annotations necessary in the first place?
When I read the book and blog articles they always focus on the what lifetimes are and how to use them, but I feel like I haven't come across a clear answer to this question.
If the question isn't clear here's a playground example of the compiler requiring lifetimes, but already knowing where they need to go.
Appreciate any responses to help explain it!