3 ms·
You can always assume the former(all lifetimes are different). It is strictly more general.
by sanxiyn 8y ago
You can always assume the former(all lifetimes are different). It is strictly more general.
- giornogiovanna 8y agoThanks, so lifetimes can definitely be inferred for safe code (although just like type inference, they can lead to leaky abstractions). But aren't lifetime annotations necessary for unsafe code? How could you cast a pointer into a struct into a raw pointer and back, while preserving the lifetime, without them?