clone_from
implementations for all slot maps.try_insert_with_key
methods that accept a fallible closure.new_key_type
resistant to shadowing.Key
trait unsafe, as it was erroneously safe to implement.HopSlotMap::retain
that had the same underlying cause as the fix in 1.0.4 but was missed.HopSlotMap::drain
. All versions 0.3+ are affected, and thus yanked.get_disjoint_mut
available on stable Rust 1.51 and up.SparseSecondaryMap
.new_key_type!
macro, it assumed the Key
trait was in scope.[u32; N]
was created. The uninitialized values were never read - the code always initialized them before reading - but simply having the variable be uninitialized (despite all bit patterns being valid) is technically undefined behavior.Removed all Copy
trait restrictions of value types stable Rust! There are no longer any restrictions on the types you can store in any of the slot maps. For that reason Slottable
was deprecated as well.
no_std
support was added, use it by opting out of the default feature std
.
Added sm.get_disjoint_mut([k1, k2, ...])
which allows you to get mutable references from multiple disjoint keys at the same time. This requires min-const-generics
to be stabilized, so until Rust 1.51 comes out this is only available on nightly by setting the unstable
feature.
Added an Entry
API to the secondary maps.
Added derive(Clone)
for iterators where possible.
Replaced Into<KeyData>
with Key::data()
.
SecondaryMap
now uses minimal space overhead. Each slot now uses max(sizeof(T), 4)
bytes.
Moved SlotMap
to the basic
module.
Codebase moved to 2018 Edition.
Reintroduce DenseSlotMap
- an overzealous removal in 0.3.0.
Added support for try_reserve
.
Added support for custom hashers in SparseSecondaryMap
.
SparseSecondaryMap
and SecondaryMap
can now be cloned.
Keys have a more terse debug output.
Fixed a bug that caused an overflowing left shift on 32-bit targets.
Massive rework, with a focus on secondary maps and custom keys to prevent cross-slotmap key usage.
Removed DenseSlotMap
in favour of HopSlotMap
as the latter performs better when secondary maps are in use.
Unfortunately due to the redesign the first slot in a slot map must now always be empty. This means some deserializations of slot maps serialized with a version before 0.3.0 can fail.
Added SecondaryMap
and SparseSecondaryMap
, which allows you to associate extra data with keys given by a slot map.
Added DefaultKey
, custom key types, and support for them on all slot maps and secondary maps. You must now always specify the key type you're using with a slot map, so SlotMap<i32>
would be SlotMap<DefaultKey, i32>
. It is recommended to make a custom key type with new_key_type!
for any slot map you create, as this entirely prevents using the wrong key on the wrong slot map.
KeyData
now has as_ffi
and from_ffi
functions that convert the data that makes up a key to/from an u64
. This allows you to use slot map keys as opaque handles in FFI code.
Fixed a potential uninitialized memory vulnerability. No uninitialized memory was read or used directly, but Rust's assumptions could lead to it. Yanked all previous versions as they were all vulnerable.
Made a Key
member non-zero so that Option<Key>
is optimized.
Start of version history.