Skip to content

Commit 83257ac

Browse files
committed
Deprecating hashbrown stable hash reexports
1 parent 381f3d3 commit 83257ac

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

crates/bevy_reflect/src/utility.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
//! Helpers for working with Bevy reflection.
22
33
use crate::TypeInfo;
4+
#[allow(deprecated)]
45
use bevy_utils::{FixedState, StableHashMap};
56
use std::{
67
any::{Any, TypeId},
@@ -195,6 +196,7 @@ impl<T: TypedProperty> NonGenericTypeCell<T> {
195196
/// ```
196197
/// [`impl_type_path`]: crate::impl_type_path
197198
/// [`TypePath`]: crate::TypePath
199+
#[allow(deprecated)]
198200
pub struct GenericTypeCell<T: TypedProperty>(RwLock<StableHashMap<TypeId, &'static T::Stored>>);
199201

200202
/// See [`GenericTypeCell`].
@@ -207,6 +209,8 @@ impl<T: TypedProperty> GenericTypeCell<T> {
207209
pub const fn new() -> Self {
208210
// Use `bevy_utils::StableHashMap` over `bevy_utils::HashMap`
209211
// because `BuildHasherDefault` is unfortunately not const.
212+
213+
#[allow(deprecated)]
210214
Self(RwLock::new(StableHashMap::with_hasher(FixedState)))
211215
}
212216

crates/bevy_utils/src/lib.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,9 @@ pub type HashMap<K, V> = hashbrown::HashMap<K, V, BuildHasherDefault<AHasher>>;
9696
/// of insertions and deletions and not a random source.
9797
///
9898
/// aHash is designed for performance and is NOT cryptographically secure.
99+
#[deprecated(
100+
note = "Will be required to use the hash library of your choice. Alias for: hashbrown::HashMap<K, V, FixedState>"
101+
)]
99102
pub type StableHashMap<K, V> = hashbrown::HashMap<K, V, FixedState>;
100103

101104
/// A [`HashSet`][hashbrown::HashSet] implementing aHash, a high
@@ -111,6 +114,9 @@ pub type HashSet<K> = hashbrown::HashSet<K, BuildHasherDefault<AHasher>>;
111114
/// of insertions and deletions and not a random source.
112115
///
113116
/// aHash is designed for performance and is NOT cryptographically secure.
117+
#[deprecated(
118+
note = "Will be required to use the hash library of your choice. Alias for: hashbrown::HashMap<K, V, FixedState>"
119+
)]
114120
pub type StableHashSet<K> = hashbrown::HashSet<K, FixedState>;
115121

116122
/// A pre-hashed value of a specific type. Pre-hashing enables memoization of hashes that are expensive to compute.

0 commit comments

Comments
 (0)