3 ms·
> Memory safety and "no undefined behaviors" (obviously untrue, but that was the belief and part of the conversation we had to have Trying to better understand
by vander_elst 2y ago
> Memory safety and "no undefined behaviors" (obviously untrue, but that was the belief and part of the conversation we had to have
Trying to better understand this claim, is it because also unsafe rust exists?
- eru 2y agoThere are a few corners of undefined behaviors in Rust outside of 'unsafe' blocks, too.
- estebank 2y agoAre you taking about the open unsoundness bugs?
- eru 2y agoI remember something about being able to transform any lifetime into a static lifetime entirely within safe Rust. But I can't find the link to it right now.
- estebank 2y agoIt's either https://github.com/rust-lang/rust/issues/112905 https://github.com/rust-lang/rust/issues/112905, https://github.com/rust-lang/rust/issues/84366 https://github.com/rust-lang/rust/issues/84366 or (most likely) https://github.com/rust-lang/rust/issues/25860 https://github.com/rust-lang/rust/issues/25860. It can be argued that those are bugs of the compiler, not the language (but in practice that doesn't matter, it's unsound in the only way that matters now!) and that it's very unlikely to be hit by accident (but someone can leverage it intentionally to cause unsoundness in their library, without the presence of unsafe).
- eru 2y agoThanks! Yes, I think it was the last one, https://github.com/rust-lang/rust/issues/25860 https://github.com/rust-lang/rust/issues/25860. But I'm not 100% sure.