3 ms·
I don't follow.that logic: If you can mark sections of Rust unsafe why could language X not allow marking sections of X as "safe"? Then over time you can use o
by eatonphil 4y ago
I don't follow.that logic: If you can mark sections of Rust unsafe why could language X not allow marking sections of X as "safe"?
Then over time you can use only 3rd party packages that are fully safe (same as has happened naturally with rust but just "not unsafe").
- viraptor 4y agohttps://doc.rust-lang.org/book/ch19-01-unsafe-rust.html https://doc.rust-lang.org/book/ch19-01-unsafe-rust.html > 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. Going from the other side would be really hard to design for. The whole standard library in rust is relying on the lifetimes being there. If you started without them you'd end up with things which can't be implemented safely anymore. Even with the lifetimes available, some traits took ages to stabilise and ensure no edge cases. You'd have two standard libraries and the compiler would have to know how to make them interact. Or maybe they couldn't interact and you'd have to remember some hashes have get/set you started with and others need `.entry(...).and_modify(...)`. That sounds terrible for usability.