External Publication
Visit Post

`alloc`-only `HashMap`?

Rust Internals [Unofficial] April 10, 2026
Source

I don't know why you're focusing so much on randomness when nothing in my post requires any random input.

In std's current HashMap, the RandomState default implementation requires randomness, but I can provide my own argument that does whatever I want, which may or may not involve randomness.

My proposal was that code with only alloc would be able to use HashMaps but would have to provide an explicit BuildHasher. This could pull in randomness from some source, or depending on the code it might not need randomness at all if the keys are trusted input data.

Discussion in the ATmosphere

Loading comments...