)]}'
{
  "commit": "1a002cfbbcd39aeeb558379ffc5d35068c0f6c90",
  "tree": "cc605a9fda1888c4c96f4517ce2512491b4a428e",
  "parents": [
    "dc859fc4ab4e849632bc3a546cb4862056ee8fa5",
    "d471202631fd097101bfa12fbc9680d2b4a93093"
  ],
  "author": {
    "name": "Jacob Pratt",
    "email": "jacob@jhpratt.dev",
    "time": "Sat Aug 29 01:18:52 2026 -0400"
  },
  "committer": {
    "name": "GitHub",
    "email": "noreply@github.com",
    "time": "Sat Aug 29 01:18:52 2026 -0400"
  },
  "message": "Rollup merge of #161858 - khyperia:ice-generic_const_parameter_types, r\u003dBoxyUwU\n\nfix ICE in generic_const_parameter_types with inherents\n\ntracking issue: https://github.com/rust-lang/rust/issues/137626\n\nrelevant PR where the code was added: https://github.com/rust-lang/rust/pull/154853 (fyi ping @lapla-cogito - nws that this was buggy, it\u0027s extreeeemely subtle and easy to miss! :heart: I mean, I also reviewed that PR and missed it too :3 )\n\ndiscovered when implementing a change that explicitly tracks whether the args for inherent associated consts are in \"self form\" or \"impl form\"\n\nFollowing along the test case:\n\n- `normalize_canonicalized_inherent_projection` is called with `AliasTermKind::InherentConst` with the generic args being in \"self form\", i.e. `[ThreeTypes\u003cu8, u16, u32\u003e]`\n- `traits::normalize_inherent_projection` is called with said alias\n  - it calls `compute_inherent_assoc_term_args`, which does the dance of generating fresh vars for each param in the impl block, equating with the self type, and returning what the fresh vars solved to. This converts from \"self args\" to \"impl args\", i.e. `[u8, u16, u32]`\n  - it then calls `const_of_item` and instantiates with `[u8, u16, u32]`. this is correct and good, `const_of_item` expects \"impl form\" args.\n  - it then calls `push_const_arg_has_type_obligation`\n    - which calls `type_of` and instantiates with `[u8, u16, u32]` to fetch the type of the const, to be able to register a `ConstArgHasType`. this is correct and good, `type_of` expects \"impl form\" args.\n  - `traits::normalize_inherent_projection` returns, dropping the impl form args it computed\n- `normalize_canonicalized_inherent_projection` calls `ocx.register_obligations(const_arg_has_type_obligation(...))`, passing `goal`. Remember that `goal` has the original \"self args\" generic arg format.\n  - `const_arg_has_type_obligation` calls `type_of` and instantiates with `[ThreeTypes\u003cu8, u16, u32\u003e]`. This is no good very bad!! `type_of` expects \"impl form\" args, not \"self form\"!!\n  - ICE!! `type parameter T3/#2 (T3/#2/2) out of range when instantiating, args\u003d[ThreeTypes\u003cu8, u16, u32\u003e]`\n\nThe reason I filed this under `feature(generic_const_parameter_types)` is because for this bug to manifest, `type_of` must return a type that actually references a generic param to be able to trigger an ICE. Otherwise, the buggy incorrect args are silently ignored and compilation continues \"fine\".\n\nThe fix:\n\n`normalize_inherent_projection` already registers a `ConstArgHasType`. why are we doing it a second time. just delete it. :skull:\n\nr? @BoxyUwU\n",
  "tree_diff": []
}
