3 ms·
> As I understand it, unsafe pretty much says "what you are doing here may violate memory safety". I don't think this is true in general. Unsafe is used pretty
by thinkharderdev 2y ago
> As I understand it, unsafe pretty much says "what you are doing here may violate memory safety".
I don't think this is true in general. Unsafe is used pretty frequently for things that are themselves memory safe but may violate invariants which can cause memory unsoundness in other places. An example would be `std::str::from_utf8_unchecked` which is not itself memory unsafe. But various safe methods on `str` are memory safe ONLY if the str contains valid UTF8