4 ms·
I'm wondering why the lifetimes as described in steps 2 and 3 need to be so explicit. Why shouldn't the borrow checker be able to infer them?
by royjacobs 2y ago
I'm wondering why the lifetimes as described in steps 2 and 3 need to be so explicit. Why shouldn't the borrow checker be able to infer them?
- nicoburns 2y agoIt probably could, but then you'd get incredibly confusing error messages if you got it wrong (and potentially when modifying code in a completely different part of the code base).
- DylanSp 2y agoProbably for the sake of explanation, to show how the new "lifetimes" and types would work from a user's perspective, even if they could be inferred in practice.