In the nomicon book, I see the following paragraph. Is there anyone explain how the BTreeMap is written to be robust against Ord via std library source?
BTreeMapdoesn't really make sense for partially-ordered types, and so it requires that its keys implement
BTreeMaphas Unsafe Rust code inside of its implementation. Because it would be unacceptable for a sloppy
Ordimplementation (which is Safe to write) to cause Undefined Behavior, the Unsafe code in BTreeMap must be written to be robust against
Ordimplementations which aren't actually total — even though that's the whole point of requiring