I feel like both of these are part of a more over-arching issue: lifetimes can often be annoying to work with.
From a (shallow) ergonomics standpoint, it would be awesome if Rust could just infer all lifetime parameters, and only shout errors at you when the situation is unresolvable for some reason. However, there is at least one significant problem with doing that: you really want lifetimes to be explicit at API boundaries, because they are actually part of the API.
My understanding is that this is the primary rationale behind requiring explicit lifetime annotations for e.g. function signatures, data structure declarations, etc. All of those things amount to API boundaries, and thus lifetimes are something that should both be thought about and made explicit.
But are functions etc. really Rust’s API boundaries? It seems to me that the real API boundaries in Rust are modules. Specifically, public members of modules. It would be amazing if Rust could infer lifetimes in private function signatures, private data structures, private traits, etc. This would make it significantly easier to write e.g. helper functions for code with complex lifetime requirements.
In fact, arguably, maybe the real API boundaries of Rust are crates. Maybe lifetimes could be inferred for all private things within a crate. Then people would only (strictly) need to write lifetime annotations for the publicly exposed parts of crates. This could significantly simplify e.g. writing application code, among other things, while still enforcing that crates are explicit about the lifetimes in their API’s and therefore don’t accidentally break their API promises.
So, having said all of that… I’m not actually advocating for anything in particular here. There are probably issues or complexities with what I’ve written above that I’m not aware of. But I wanted to put these ideas out there to maybe spark some discussion of how Rust can make working with lifetimes less of a hassle in a broader sense, rather than just as a set of one-off use cases.