Language vision regarding safety guarantees
Rust Internals [Unofficial]
July 1, 2026
I would say that if the type's Ord implementation is incorrect, then insert_before_unchecked's safety requirement should (but is not currently written to) not apply. This resolves the conflict: in the case where nonsensical inserts can happen from safe code, nonsense is sound.
Discussion in the ATmosphere