2 ms·
> Like, sure, we could make that argument for any runtime invariant. One difference is that Rust has a separate type for String-like objects that do not respec
by zozbot234 5y ago
> Like, sure, we could make that argument for any runtime invariant.
One difference is that Rust has a separate type for String-like objects that do not respect the invariant, namely Vec<u8>. So those who wish to write memory-safe code acting on arbitrary bytes can simply use that. Also, it's quite normal for an invariant defined entirely in Safe Rust to impact memory safety in a very real sense; consider Send and Sync. These are seemingly arbitrary labels, but their semantics is nonetheless quite well defined.