Rust Unsafe Keyword
Cluster focuses on debates about Rust's `unsafe` keyword, including its meaning, whether it compromises overall safety, its role in building safe abstractions, and necessity for low-level code.
Activity Over Time
Top Contributors
Keywords
Sample Comments
It's not possible, because unsafe does not turn anything off; unsafe is a superset of safe.
Not really. `unsafe` is the footgun.
Why not though (for safety-critical code)? How can it be safe with `unsafe`?
`unsafe` doesn't mean that it's not safe, just that the compiler can't prove that it's safe so the human has to do it manually.
It's got really not much at all to do with `unsafe`.
and yet an article about a 'safe' language has code examples full of 'unsafe'... wut.
No on both counts, the entire point of "unsafe" is to form safe abstractions around unprovably safe code.
What's the problem with unsafe? Isn't the whole point to isolate the unsafe behavior into specific parts of the code?
There's necessary and well-encapsulated `unsafe` code in the standard library. It's a tool.
No. As soon as there's unsafe code, there's the possibility of safe code misusing the unsafe code to create unsafe behavior. One would like to have un-abusable unsafe code, but the language does nothing to guarantee that.