|
Yes, that's a very common misconception. Of course, if your program compiles, that doesn't mean the logic is correct. However, if your program compiles _and_ the logic is correct, there's a high likelihood that your program won't crash (provided you handle errors and such, you cannot trust data coming from outside, allocations to always work, etc). In Rust's case, this means that the compiler is much more restrictive, exhaustive and pedantic than others like C's and C++'s. In those languages, correct logic and getting the program to compile doesn't guarantee you are free from data races or segmentation faults. Also, Rust's type system being so strong, it allows you to encode so many invariants that it makes implementing the correct logic easier (although not simpler). |
That is one hell of a copium disclaimer. "If you hold it right..."