3 ms·
Not that I know of. But few other languages have a borrow checker. You can do this in Rust at run time, with Rc, Weak, and .upgrade().unwrap(). If none of the
by Animats 3y ago
Not that I know of. But few other languages have a borrow checker.
You can do this in Rust at run time, with Rc, Weak, and .upgrade().unwrap(). If none of the .unwrap() calls fails, you did it right. If you can prove the unwrap calls can't fail, you don't need the run time checking. So the goal is to check at compile time something you can now check at run time at higher cost. That's what Rust is all about.