3 ms·
> That is not idiomatic Rust I'm not sure where one would get the idea that `unsafe` would be entirely forbidden in idiomatic Rust. "Idiomatic" Rust acknowledg
by kibwen 10y ago
> That is not idiomatic Rust
I'm not sure where one would get the idea that `unsafe` would be entirely forbidden in idiomatic Rust. "Idiomatic" Rust acknowledges the danger and subtle pitfalls of unsafe code, and thereby discourages the use of `unsafe`, but also acknowledges that it is still possible to build safe abstractions out of internally-unsafe code.
> in order to get similar performance to C++ data structures
By Rust's definition, every line of code in a C++ codebase counts as unsafe code. :P If Rust can get equivalent performance to C++ while only using exposing 1% of the code to unsafety, that's an enormous win.