`alloc`-only `HashMap`?
Rust Internals [Unofficial]
April 6, 2026
A few alternatives:
Have you considered using the hashbrown crate? It is the crate std uses for its hashmap/hashset implementation. This crate is no_std compatible.
If you don't want to add a new dependency, then you could use BTreeMap and BTreeSet, which do live in the alloc crate.
If you do need HashMap specifically, then you are a bit out of luck.
Discussion in the ATmosphere