{
"$type": "site.standard.document",
"bskyPostRef": {
"cid": "bafyreiaajwn7saprvnvuu6mdmpcrqukceanjjghx6ssgqbeodouawon2yi",
"uri": "at://did:plc:ivbknywyskln22er3nkssdhl/app.bsky.feed.post/3mizs52czbpj2"
},
"path": "/t/alloc-only-hashmap/24071#post_15",
"publishedAt": "2026-04-08T19:15:11.000Z",
"site": "https://internals.rust-lang.org",
"textContent": "That situation already describes `alloc` as-is. If you depend on it there must be a `GlobalAlloc` instance somewhere but `alloc` itself will not (strongly) provide that symbol on a per-target basis. Instead, there's a declared `GlobalAllocator` singleton-type with the interface that's relaying calls to some user-defined symbol annotated with a macro, which must appear somewhere in the final crate graph.\n\nThere's a compatibility problem, we can't outright add the requirement to `alloc` without a fallback but fallbacks are the problem, but the concept itself is established. If that were a normal crate, I'd say to put the data structures under a new feature flag..",
"title": "`alloc`-only `HashMap`?"
}