External Publication
Visit Post

Language vision regarding safety guarantees

Rust Internals [Unofficial] June 30, 2026
Source

But the caller (BTreeMap) does call it with invalid type/input combinations today, according to its stated safety requirement, if the key type has a broken Ord implementation.

The safety comments in BTreeMap's source code for the calls to insert_before_unchecked assume that Ord is non-broken, which is not a sound assumption given that Ord is not a safe trait.

Discussion in the ATmosphere

Loading comments...