Hacker News new | past | comments | ask | show | jobs | submit login

No, when used as a bound, it doesn't really say how long data has to live. It just forbids use of all temporary references (types that are borrowing from something short-lived they don't own).

Lifetime requirements simply don't apply at all to types that own their data. Or another way to see it is that self-contained types like Vec and String automatically meet every lifetime requirement, regardless of how long or short they actually live.

Rust kinda screwed up with terminology here, because the general computing term of "object lifetime" applies to more things than the specific 'lifetime concept that Rust applies to references/loans.




Thanks for the explanation. I understand it now.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: