Language vision regarding safety guarantees
Rust Internals [Unofficial]
July 1, 2026
ais523:
The safety comments in
BTreeMap's source code for the calls toinsert_before_uncheckedassume thatOrdis non-broken, which is not a sound assumption given thatOrdis not a safe trait.
Safety requirements are for external callers from outside of the abstraction boundary. When calling functions in your own module / crate you can ignore documented safety requirements.
Discussion in the ATmosphere