|
|
|
|
|
by shadowmint
4252 days ago
|
|
It is effectively impossible to have an unsafe memory access error in Rust
Please, don't say that. Lets be reasonable. Rust is great, but Rust code crashes and segfaults too, just like any language, programs have bugs, and those bugs can cause program failure.Rust just has less of them, because it has a smart compiler. ...but it's not right to suggest that it has none. Remember: There is no way of ensuring that a rust program does not result in a segmentation fault or other memory or race condition as a result of unsafe code. There is no way of ensuring a rust program does not contain any unsafe code. |
|
There's no way to ensure the compiler is perfect, but rust itself is not capable of certain types of errors.
You can always code the wrong algorithm, but that doesn't mean you can segfault or use after free (in the default safe mode you almost never have an excuse to leave).