{
  "$type": "site.standard.document",
  "bskyPostRef": {
    "cid": "bafyreihre3rk64o26tdkahmxlinl4tike6h5vyoa2tkbcr24s3p5vfbll4",
    "uri": "at://did:plc:ivbknywyskln22er3nkssdhl/app.bsky.feed.post/3mizs55l4frj2"
  },
  "path": "/t/alloc-only-hashmap/24071#post_14",
  "publishedAt": "2026-04-08T19:00:05.000Z",
  "site": "https://internals.rust-lang.org",
  "textContent": "We do not even have `core::io` or `alloc::io` yet, despite there being massive numbers of crates that depend upon external projects that supply `io::{Read,Write}` outside std.\n\nAnything that touches randomness sounds vastly more complex. lol\n\nWe could've some uninhabited type like\n\n\n    pub enum RandomState { };\n\n\nor alternatively\n\n\n    pub type DefaultHasher = !;\n    impl BuildHasher for RandomState {\n        type Hasher = !;\n        fn build_hasher(&self) -> ! {\n            panic!(\"Instantiated HashMap outside std!\")\n        }\n    }\n\n\nYet, these merely force you into declaring your randomness source, so the code would be less compatible than simply doing `pub type HashMap = getrandom_hashmap::HashMap` or whatever. Not great\n\nIf I read correctly, getrandom has 14 different target_os options and another 12 features, including many options only accessible through RUSTFLAGs to avoid cargo feature additivity. I doubt std ever supports all those options.\n\nAlso, we could even migrate the ecosystem away from std::collections::HashMap and towards some semi-blessed probabilistic data structures project that always uses getrandom everywhere, so morally shrink std but not really.",
  "title": "`alloc`-only `HashMap`?"
}