)]}'
{
  "commit": "fdfba6737d9718efd73cbded185265a8c4dcd9f3",
  "tree": "e1cc221ee3934a730db5b57ec4f6e1d19d434694",
  "parents": [
    "4c9d2bfe4ad7a65669098754964aaebe0ec1ced2"
  ],
  "author": {
    "name": "Nicholas Nethercote",
    "email": "n.nethercote@gmail.com",
    "time": "Wed Jul 01 14:38:58 2026 +1000"
  },
  "committer": {
    "name": "Nicholas Nethercote",
    "email": "n.nethercote@gmail.com",
    "time": "Thu Jul 02 17:10:35 2026 +1000"
  },
  "message": "Clarify some interning details\n\n`Interned` does pointer equality/hashing, which is valid in two cases.\n- The values are guaranteed to be unique (e.g. via interning, or\n  construction). This is how `rustc_middle` uses `Interned`.\n- The type has \"identity\" and different values should be considered\n  distinct even if they are identical. This is how `rustc_resolve` uses\n  `Interned`.\n\nPR 137202 tried to clarify things by adding a `T: Hash` constraint to\n`Interned\u003c\u0027a, T\u003e`. This constraint isn\u0027t actually used, because\n`Interned` is hashed based on pointer value, not contents. But it was\nintended to communicate the idea that a type stored in `Interned` is\nactually interned, which is likely to be done with hashing. Panicking\nimpls of `Hash` were added for the relevant `rustc_resolve` types to\nwork around the fact that it doesn\u0027t use hashing-based interning.\n\nIn my opinion PR 137202 didn\u0027t improve things. The `T: Hash` constraint\nis only aimed at the interning case, and even for that case it\u0027s not\nquite right because you could use a `BTreeMap` to intern instead of a\n`HashMap`.\n\nThis commit does several things.\n- Removes the `T: Hash` constraint and the `Hash` impls for\n  `rustc_resolve` types added in PR 137202.\n- Improves the comments on `Interned` to cover the non-interning cases.\n- Removes the `PartialOrd`/`Ord` impls on `Interned` because (a) they\u0027re\n  not used, and (b) their meaning is unclear for the \"identity\" case.\n- Improves the documentation in `rustc_resolve` to explain how\n  `Interned` usage is valid there.\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "042cf1910adc8548e9e9c3a51f23ddf1c6dcb472",
      "old_mode": 33188,
      "old_path": "compiler/rustc_data_structures/src/intern.rs",
      "new_id": "382c921f198e05743b9cd49de0f1be75264183af",
      "new_mode": 33188,
      "new_path": "compiler/rustc_data_structures/src/intern.rs"
    },
    {
      "type": "modify",
      "old_id": "a85cd480a09f6313679fabb17d3d8b159025cbfd",
      "old_mode": 33188,
      "old_path": "compiler/rustc_data_structures/src/intern/tests.rs",
      "new_id": "8b814bff1301ae3567161557adbdb5935ccb5cc5",
      "new_mode": 33188,
      "new_path": "compiler/rustc_data_structures/src/intern/tests.rs"
    },
    {
      "type": "modify",
      "old_id": "c4d668edefa32a7ffe14d7d3583b136fc4fa306c",
      "old_mode": 33188,
      "old_path": "compiler/rustc_resolve/src/imports.rs",
      "new_id": "379ae992c9a6ee91b7850e83a1c391a95ae6108e",
      "new_mode": 33188,
      "new_path": "compiler/rustc_resolve/src/imports.rs"
    },
    {
      "type": "modify",
      "old_id": "3b93f2d1fd130957690073cf8ae86958cfc0a773",
      "old_mode": 33188,
      "old_path": "compiler/rustc_resolve/src/lib.rs",
      "new_id": "2ceec78bd300b360f036e2b239f3556f3e8a28fc",
      "new_mode": 33188,
      "new_path": "compiler/rustc_resolve/src/lib.rs"
    }
  ]
}
