3 ms·
> Explicit lifetimes I never understood that one either. There is always only one "solution" that will make your program compile, so why not just let the compi
by olalonde 3y ago
> Explicit lifetimes
I never understood that one either. There is always only one "solution" that will make your program compile, so why not just let the compiler figure it out?
- steveklabnik 3y agoI wrote a blog post about this. https://steveklabnik.com/writing/rusts-golden-rule https://steveklabnik.com/writing/rusts-golden-rule I did not mention lifetimes, but the principle is the exact same: the lifetime annotations are an API promise, and so inferring them means that a change in the body of the function would change the promise, breaking other code.