3 ms·
What is 2% of the Rust code is in unsafe blocks so you do something useful?
by tus88 7y ago
What is 2% of the Rust code is in unsafe blocks so you do something useful?
- timw4mail 7y agoRust unsafe blocks are generally a few different things: * Calls to C functions (which can't be checked for safety) * Cycles or mutable access which can't be checked for safety by the compiler * Performance-sensitive code, which ignores bounds checking (again, which can't be checked for safety by the compiler) The point of `unsafe` is to fence in the memory danger into the smallest possible points.