{
  "$type": "site.standard.document",
  "bskyPostRef": {
    "cid": "bafyreicpskksim5bgyjejviicrukreiimrxtfnh5wmxxyxie2arjhf7meu",
    "uri": "at://did:plc:ivbknywyskln22er3nkssdhl/app.bsky.feed.post/3mkb57pisa3r2"
  },
  "path": "/t/could-collections-hypothetically-store-keys-and-values-inline/24195#post_5",
  "publishedAt": "2026-04-24T16:45:57.000Z",
  "site": "https://internals.rust-lang.org",
  "textContent": "robofinch:\n\n> The data structures in `std::collections`, however, do not explicitly document that they never store values (or, if applicable, keys) inline; AFAICT, this is technically \"just\" an undocumented implementation detail of `std`. Should I start making an RFC requesting this guarantee?\n\nWhy would you want to make that guarantee? I could absolutely see the case for HashMap using specialisation in the future to store small keys and values inline. This is not something that is realistic in Rust today given the poor state of specialisation, but a `HashMap<u32, u32>` could absolutely benefit from inline storage.\n\nAdditionally whatever the backing store is, it could get reallocated, so even a guarantee of not inlining doesn't give you address stability.",
  "title": "Could collections hypothetically store keys and values inline?"
}