docs(allocator): improve docs for HashMap (#8616)

Clarify docs for `HashMap` on `Drop` restriction.
This commit is contained in:
overlookmotel 2025-01-20 11:46:13 +00:00
parent 87568a1942
commit 01a5e5d74a

View file

@ -45,7 +45,7 @@ type FxHashMap<'alloc, K, V> = hashbrown::HashMap<K, V, FxBuildHasher, &'alloc B
/// which own memory allocations outside the arena.
///
/// Static checks make this impossible to do. [`HashMap::new_in`] and all other methods which create
/// a [`HashMap`] will refuse to compile if called with a [`Drop`] type.
/// a [`HashMap`] will refuse to compile if either key or value is a [`Drop`] type.
///
/// [`FxHasher`]: rustc_hash::FxHasher
pub struct HashMap<'alloc, K, V>(ManuallyDrop<FxHashMap<'alloc, K, V>>);