{
  "$type": "site.standard.document",
  "bskyPostRef": {
    "cid": "bafyreidn27wq36l5n6i3iu3q522avsvfsbbx5zi5vkrlrq7grtif43pr2e",
    "uri": "at://did:plc:ivbknywyskln22er3nkssdhl/app.bsky.feed.post/3ml4qg5gga362"
  },
  "path": "/t/mutation-creation-of-hir/24214#post_11",
  "publishedAt": "2026-05-05T17:03:01.000Z",
  "site": "https://internals.rust-lang.org",
  "textContent": "chrefr:\n\n> The compiler, of course, is the source of truth. Specifically when asking whether a program can compile, rust-analyzer is unlikely to give you accurate answers, since its diagnostics are very far and few currently.\n\nYes, that was my intuition as well. Unfortunately, my rewriting tool often needed to verify that the program indeed compiles, which has pushed me toward using the `rustc` APIs rather than `rust-analyzer`. That said, I would be very interested in improving the ergonomics of these APIs; I imagine that `rust-analyzer` could also benefit from such improvements. Do you know anyone who might be interested in this topic or who could mentor me in implementing these changes?\n\n> How were you able to map the information found on the HIR back to the AST to perform your modifications based on it? I am currently using spans but I am not sure if this approach is reliable.\n\nYes, I am using spans. They also seemed brittle to me, but I haven't run into any issues yet.",
  "title": "Mutation/Creation of HIR"
}