{
  "$type": "site.standard.document",
  "bskyPostRef": {
    "cid": "bafyreid346haagvqrkb4pu7wt72untdp44tiayxd3gdwcaiaqu3ose5gqi",
    "uri": "at://did:plc:ivbknywyskln22er3nkssdhl/app.bsky.feed.post/3mkra5kdilbe2"
  },
  "path": "/t/mutation-creation-of-hir/24214#post_3",
  "publishedAt": "2026-05-01T02:16:30.000Z",
  "site": "https://internals.rust-lang.org",
  "textContent": "Could you expand a bit in this answer I am new to working with the compiler.\n\nMy understanding is that arena allocated means that the whole HIR is in the same region of memory sharing the same lifetime. My guess as to why the HIR is NOT clonable in the arena is because the compiler uses pointers to for type comparisons (so if we clone same types would have different identifiers). Given that it has interior shared references I understand now also why it is not mutable.\n\nI do not understand what you meant by \"Mutating one thing requires cloning everything.\"\n\nI wanted to create a copy of the HIR (maybe to a new arena) that I could modify or maybe just build my own based on the original copy and compile that instead. Is this just not possible?\n\nThank you!",
  "title": "Mutation/Creation of HIR"
}