Friends learning Rust: writing about lifetimes is something I get requests for a lot, but it's hard for me to know exactly where people are stuck.
If you're stuck, can you tell me where? Maybe you're reading the book and some part doesn't click? Ask about it with your words!
Conversation
Existential lifetimes when?
Super frustrating when NLL cna figure out a thing I write, but then I can't split it out into a separate function/definition 😖
1
To clarify, NLL is amazing and awesome and I'm glad it's in there! But yeah, it does mean you can run into situations where you literally can't split something into smaller parts. 😅
that's... intentional. you'd need much more complexity in what you can describe in signatures to be able to handle all of the intra-function situations
borrowing only a subset of fields, or even with separate borrows, is the biggest thing AFAIK
1
I guess one thing I wish for is `fn foo() -> exists<'a> Bar<'a>`, which can be pretty handy for testing. But yeah, I guess in the general case it could definitely get mighty complicated…


