Jai-Community/Jai-Community-Library

Section about Rust has some issues

Closed this issue · 1 comments

Rust allows programmers to deliberately turn off the borrow checker to temporarily bend the rules in order to do what you want.

is incorrect, since unsafe doesn't allow disabling borrow checker. Rust compiler does not allow disabling borrow checker at all, ever. Only things unsafe allows you to do is to dereference raw pointers, call unsafe functions, implement unsafe traits, mutate statics and access union fields1. It still checks references inside unsafe blocks for validity.

A better way would be to phrase it like so

Rust allows programmers to deliberately turn off some safety features to temporarily bend the rules in order to do what you want.

Similarly, in section about pointers, technically Rust allows pointers everywhere, and only dereferencing them requires using unsafe.

Additionally, the syntax for mutable variables is incorrect: should be mut x: int instead if x: mut int.

Then,

Rust is a "big idea" language that uses static compile-time formal verification in an attempt to prevent all bugs.

is wrong, as borrow checker only attempts to prevent memory-related bugs.

Footnotes

  1. https://doc.rust-lang.org/nomicon/what-unsafe-does.html

thanks. As the person who wrote the section about Rust, I tried my best to write about it, but my knowledge is not very accurate. This section has been changed to more accurately reflect better information on Rust.