News for hackers. Stuff that matters.
Re:Ask HN: How do I understand Rust? by nonsince on Friday January 27, 2017 @06:04PM (#13503555)
The rest of the points here are excellent, but don't use `unsafe` until you have completely internalised the borrow checker rules. If your safe attempt is unsafe (and therefore doesn't pass the borrow checker), your unsafe code will be unsafe too. The only difference is that the unsafe code won't be caught at compile-time.
Re:Ask HN: How do I understand Rust? by eximius on Saturday January 28, 2017 @11:31AM (#13507181)
This is not true, in general. The borrow checker has many limitations where it cannot prove that something is safe, so it assumes it is unsafe. The classic example is borrowing disjoint slices from an array.
Re:Ask HN: How do I understand Rust? by stymaar on Saturday January 28, 2017 @03:05PM (#13508772)
The borrow checker has limitations but I agree with gp: if you haven't fully internalized its rules, especially if don't understand why it is yelling at you at some point, then you should not go unsafe because you're most likely going to write memory bugs.