rust-skiplist
rust-skiplist copied to clipboard
`OrderedSkipList::new` is unsound
OrderedSkipList
relies on the comparison function being well-behaved for safety purposes. OrderedSkipList::new
uses the comparison function provided by the type's PartialOrd
implementation, but this comparison function may not be well-behaved. From the documentation of PartialOrd
:
Violating these requirements is a logic error. The behavior resulting from a logic error is not specified, but users of the trait must ensure that such logic errors do not result in undefined behavior. This means that
unsafe
code must not rely on the correctness of these methods.