|
|
|
|
|
by chlorion
960 days ago
|
|
From this link: >It’s important to understand that unsafe doesn’t turn off the borrow checker or disable any other of Rust’s safety checks: if you use a reference in unsafe code, it will still be checked. Unsafe rust basically just lets you use raw pointers, mutate static variables, use C-style unions, and do FFI calls, but otherwise it's exactly the same, and the safety checks are not in any way disabled. The main thing is that pointers let you access whatever memory you want, and borrow checking the pointer value itself doesn't prevent this. I don't think I would describe this as "switching them off", I would describe it as, "using raw pointers" or something along those lines. |
|