Conversation

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!
20
87
I've had a hunch for ages and even ranted about it once in a while, years ago every time we teach or talk about named lifetimes as if they're not *generic parameters*, we make muddle the waters like pretending <'a> is coincidental syntax reuse and not the same as <T>
3
16
another lie is "concrete lifetime". there really isn't such a thing, especially not with NLL other than I guess 'static everything is parameters and threading relationships through data structures and function signatures
2
8
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. 😅
1
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