3 ms·
For the uninitiated: Rust differentiates between safe and unsafe code (safe being the default and unsafe needing the unsafe keyword). The unsafe code is like C/
by est31 7y ago
For the uninitiated: Rust differentiates between safe and unsafe code (safe being the default and unsafe needing the unsafe keyword). The unsafe code is like C/C++: it's more powerful than safe code, allowing you to do more things, including allowing you to trigger undefined behavour. Any mistake can possibly mean UB with all the consequences of crashes, wrong behaviour and nasal demons. Safe Rust on the other hand, is not supposed to be allowed to trigger such UB, no matter what you write. If you are able to trigger UB in 100% safe code, it's considered a bug in the language, an unsoundness bug.
Note that it was known that Pin/Generators had soundness problems when you turned on noalias optimization flags [1]. They have however decided to stabilize it without fixing those problems as they could be fixed afterwards as well. I'm not entirely sure yet about the impact of this one, will have to read the thread I guess.
[1]: https://github.com/rust-lang/rust/issues/62149#issuecomment-521149328 https://github.com/rust-lang/rust/issues/62149#issuecomment-...
- deleted 7y ago[deleted]