Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
The Borrow Checker Within (smallcultfollowing.com)
23 points by todsacerdoti on June 2, 2024 | hide | past | favorite | 3 comments



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?


It 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).


Probably 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.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

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

Search: