)]}'
{
  "commit": "2492bee2b532c119285e4c8b3e6d709388bee382",
  "tree": "72aa1d72d5e511c0658897ddb3345626b1aff7d0",
  "parents": [
    "2a9b6c052671340c9b4cb15aaf5c56c4b73bd0b9"
  ],
  "author": {
    "name": "Wilfred Hughes",
    "email": "me@wilfred.me.uk",
    "time": "Mon Sep 14 16:18:14 2026 +0100"
  },
  "committer": {
    "name": "Wilfred Hughes",
    "email": "wilfred@meta.com",
    "time": "Tue Sep 15 13:23:38 2026 +0100"
  },
  "message": "fix: Panic when trait solver re-enters itself\n\nrust-analyzer would panic when the trait solver called itself, which\ncan happen during const evaluation.\n\nrustc has the same function, but doesn\u0027t panic, so just copy the rustc\nimplementation:\n\nhttps://github.com/rust-lang/rust/blob/5392d2f545c6836dc79f209bcc14ac7179dbc4f2/compiler/rustc_middle/src/ty/context/impl_interner.rs#L155\n\nThis caused SCIP crashes on the dudykr/stc, renegade-fi/renegade, and\ntikv/tikv GitHub repositories, so would presumably cause LSP crashes\ntoo.\n\nThe linked trait-system-refactor-initiative issue has a repro, but for\nreference I minimised a repro independently:\n\n    trait Tr { const N: usize; }\n    struct A\u003cconst N: usize\u003e;\n    impl\u003cconst N: usize\u003e Tr for A\u003cN\u003e { const N: usize \u003d N; }\n    const fn k\u003cT: Tr\u003e() -\u003e usize { T::N }\n    struct B\u003cconst N: usize\u003e;\n    impl\u003cconst N: usize\u003e Tr for B\u003cN\u003e where A\u003c{ k::\u003cA\u003c3\u003e\u003e() }\u003e: Tr { const N: usize \u003d 0; }\n    fn need\u003cT: Tr\u003e() {}\n    fn f() { need::\u003cB\u003c1\u003e\u003e(); }\n\nSince this is strictly removing a panic and copying rustc, I haven\u0027t\nadded a unit test with this.\n\nAI disclosure: Triaged and minimised with help by an LLM, but commit\nmessage and final code by me.\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "df7c9bfe1ec44513367fc855e9a689c3f241e0f0",
      "old_mode": 33188,
      "old_path": "crates/hir-ty/src/next_solver/interner.rs",
      "new_id": "e6e7f62aa5e1f284434538bc8268673b45e34660",
      "new_mode": 33188,
      "new_path": "crates/hir-ty/src/next_solver/interner.rs"
    }
  ]
}
