3 ms·
I played with Rust for a day and while I was impressed with the language as a whole, I felt the borrow checker left a lot to be desired. I don't think having li
by detrino 13y ago
I played with Rust for a day and while I was impressed with the language as a whole, I felt the borrow checker left a lot to be desired. I don't think having lifetime of references tied to scope works well in general. This is most evident in pattern matching where you are forced to grab your reference in the pattern (even if you don't need to use the reference until much further on), and there is no way to release it until the end of the scope (even though it can be dead much sooner).
- pcwalton 13y agoMaking the borrow checker know about the liveness of variables outside of scope is on the todo list. Like all of the borrow checker, it's fairly tricky to implement properly, but it should be doable. I don't think this issue leaves "a lot to be desired" though; it's a relatively minor tweak on the overall semantics. Having a borrow check is important, because otherwise you're left with iterator invalidation and numerous other memory safety holes.