On 21/09/14 05:57 AM, Simon Sapin wrote: > On 21/09/14 07:34, Daniel Micay wrote: >> It's not intended to be used for anything other than memory safety. > > It’s also used to maintain invariants, such as the bytes inside a String > being valid UTF-8: String::push_bytes() is unsafe, but > String::push_str() is not.
No, it's not used to maintain invariants unrelated to memory safety. Strings assume the contents are UTF-8 and violating that invariant would violate memory safety.
signature.asc
Description: OpenPGP digital signature
_______________________________________________ Rust-dev mailing list Rust-dev@mozilla.org https://mail.mozilla.org/listinfo/rust-dev