When should we mark our functions unsafe?

Or any time calling it can directly crash, e.g. by attempting invalid reads/writes, or violate internal invariants, which can later lead to invalid reads/writes. (For example, str::from_utf8_unchecked.)

1 Like