4 ms·
I tried suggesting this directly on GitHub. Here was the response: > There's an old idea of unsafe fields that would come up for datatypes. It can be emulated
by btrask 11y ago
I tried suggesting this directly on GitHub. Here was the response:
> There's an old idea of unsafe fields that would come up for datatypes. It can be emulated with a Unsafe<T> wrapper that has unsafe methods to get references to its interior, or to read/write. It's not widely used, or used at all afaik, since the gains aren't that great. People writing unsafe code generally know the issues, and that privacy is the #1 way the abstraction boundary is maintained.
https://github.com/rust-lang/rust/issues/9883#issuecomment-170716254 https://github.com/rust-lang/rust/issues/9883#issuecomment-1...
Privacy may be the best way to limit unsafety, but C and C++ already have privacy.