I think one of the biggest reasons folks get tripped up as soon as they encounter explicit lifetimes is that you are never able to interact with them concretely. It's either `'static` or some abstract relationship where the concrete values comes from the compiler.
-
-
Show this thread
-
Having the ability to say "no I mean this specific region of code" or "for this specific reborrow" would make code a lot clearer, and could almost certainly help aid in debugging lifetime issues when you encounter them.
Show this thread -
It'd also enable the ability to name the return type of a closure generically in trait bounds, which is impossible today if the closure takes a reference (since just by naming it you're implying the return type doesn't change based on input lifetime, and thus is 'static
Show this thread -
If it's unclear why naming the return type of a generic closure is hard/important today, here's an example with explanation https://play.rust-lang.org/?version=beta&mode=debug&edition=2018&gist=551a366ea33f9cf338a4c1863ebb700d …
Show this thread
End of conversation
New conversation -
-
-
I'd really like this: ascriptive lifetimes would be cool and make it so much easier to segment out horrible borrow errors to find out what's actually going wrong that said, I'm a bit wary that the mixture of ascriptive and the existing descriptive lifetimes would break things
-
Ooh I might steal that name. I was thinking named regions. > I'm a bit wary that the mixture of ascriptive and the existing descriptive lifetimes would break things Possibly. This would go through a *long* pre-rfc process. Naming the lt of `&self` makes me less wary (cont)
- 6 more replies
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.