Comment by tialaramex
Comment by tialaramex 2 days ago
Rust apparently got relatively close to not having &str as a primitive type and instead only providing a library alias to &[u8] when Rust 1.0 shipped.
Score another for Rust's Safety Culture. It would be convenient to just have &str as an alias for &[u8] but if that mistake had been allowed all the safety checking that Rust now does centrally has to be owned by every single user forever. Instead of a few dozen checks overseen by experts there'd be myriad sprinkled across every project and always ready to bite you.
It wouldn't have been an alias, it would have been struct Str([u8]). Nothing would have been different about the safety story.
https://github.com/rust-lang/rfcs/issues/2692