{
"$type": "site.standard.document",
"bskyPostRef": {
"cid": "bafyreiec33xzgonw4yzcak3l2fqajkqk3rtqck7wf3kidwwx4e3tq5wjq4",
"uri": "at://did:plc:ivbknywyskln22er3nkssdhl/app.bsky.feed.post/3mkyab54mqng2"
},
"path": "/t/mutation-creation-of-hir/24214#post_5",
"publishedAt": "2026-05-03T21:57:24.000Z",
"site": "https://internals.rust-lang.org",
"textContent": "Hello David,\n\nA similar issue came up recently while applying rewrites to a program that required type information, which the AST alone could not provide.\n\nSince directly mutating the HIR did not work well, the rewrites were kept at the AST level. Whenever additional information was needed, the AST was lowered to HIR to obtain it. One important detail is that each AST rewrite may invalidate the HIR, so a fresh lowering is required whenever the AST is modified. That said, parsing (which is not the costly part) can be skipped, as the existing AST can be reused; it implements `Clone`.",
"title": "Mutation/Creation of HIR"
}