3 ms·
>> some percentage of the code will be unsafe rust What would be the significance of that? Unsafe blocks in rust must still satisfy the borrow checker and all
by CraigJPerry 5y ago
>> some percentage of the code will be unsafe rust
What would be the significance of that? Unsafe blocks in rust must still satisfy the borrow checker and all the compiler’s safety rules. The only things unsafe gives you are:
Dereference a raw pointer
Call an unsafe function or method
Access or modify a mutable static variable
Implement an unsafe trait
Access fields of unions
From https://doc.rust-lang.org/book/ch19-01-unsafe-rust.html https://doc.rust-lang.org/book/ch19-01-unsafe-rust.html
The use of unsafe blocks does not automatically mean unsafe code?
- eloff 5y agoThose guarantees are checked by the programmer, not the compiler. Mistakes and bugs can happen, just like in C.