7 ms·
The things you may only fo in "unsafe" code are: - Dereference a raw pointer - Call an extern or unsafe function or method - Access or modify a mutable stati
by dimava 2y ago
The things you may only fo in "unsafe" code are:
- Dereference a raw pointer
- Call an extern or unsafe function or method
- Access or modify a mutable static variable
- Implement an unsafe trait
- Access fields of C unions
https://doc.rust-lang.org/book/ch19-01-unsafe-rust.html https://doc.rust-lang.org/book/ch19-01-unsafe-rust.html
In C the most basic advanced thing you do is LinkedList. In Rust implementing it with pointers is unsafe and splitting it into two parts is unsafe