3 ms·
Rust prevents classes of bugs by preventing specific patterns. This means it rejects, by definition alone, bug-free code because that bug free code uses a patt
by lelanthran 2y ago
Rust prevents classes of bugs by preventing specific patterns.
This means it rejects, by definition alone, bug-free code because that bug free code uses a pattern that is not acceptable.
IOW, while Rust rejects code with bugs, it also rejects code without bugs.
It's part of the deal when choosing Rust, and people who choose Rust know this upfront and are okay with it.
- bigstrat2003 2y ago> This means it rejects, by definition alone, bug-free code because that bug free code uses a pattern that is not acceptable. That is not true by definition alone. It is only true if you add the corollary that the patterns which rustc prevents are sometimes bug-free code.
- lelanthran 2y ago> That is not true by definition alone. It is only true if you add the corollary that the patterns which rustc prevents are sometimes bug-free code. That corollary is only required in the cases that a pattern is unable to produce bug-free code. In practice, there isn't a pattern that reliably, 100% of the time and deterministically produces a bug.