vcombey / fallible_collections

impl fallible collections in rust, quite as describe in RFC 2116
Apache License 2.0
31 stars 14 forks source link

Replace `get_unchecked_mut` in btree `slice_insert`. #37

Closed gz closed 1 year ago

gz commented 1 year ago

slice_insert will access elements out-of-bounds, which results in an assertion violation with newer rustc versions as it's undefined behavior. The fix uses pointer arithmetic to write the element.