)]}'
{
  "commit": "085da0cee4e6de6408c401ea2a807eff6b701307",
  "tree": "f053ab8a66c8026da84f2892107be2a7e01efdc9",
  "parents": [
    "b88fb8a0b0422697a8fe1573598795d7052e936c"
  ],
  "author": {
    "name": "Esteban Küber",
    "email": "esteban@kuber.com.ar",
    "time": "Sun Jan 18 20:23:18 2026 +0000"
  },
  "committer": {
    "name": "Esteban Küber",
    "email": "esteban@kuber.com.ar",
    "time": "Sun Feb 01 18:20:30 2026 +0000"
  },
  "message": "On E0308 caused by cloning a reference due to missing bounds, account for derive\n\nOn type errors where the difference is expecting an owned type and getting a reference, if the expression is a `.clone()` call and the type is annotated with `#[derive(Clone)]`, we now explain implicit bounds and suggest manually implementing `Clone`.\n\n```\nerror[E0308]: mismatched types\n  --\u003e $DIR/derive-implicit-bound-on-clone.rs:10:5\n   |\nLL | fn clone_me\u003cT, K\u003e(x: \u0026ContainsRc\u003cT, K\u003e) -\u003e ContainsRc\u003cT, K\u003e {\n   |                                            ---------------- expected `ContainsRc\u003cT, K\u003e` because of return type\nLL |     x.clone()\n   |     ^^^^^^^^^ expected `ContainsRc\u003cT, K\u003e`, found `\u0026ContainsRc\u003cT, K\u003e`\n   |\n   \u003d note: expected struct `ContainsRc\u003c_, _\u003e`\n           found reference `\u0026ContainsRc\u003c_, _\u003e`\nnote: `ContainsRc\u003cT, K\u003e` does not implement `Clone`, so `\u0026ContainsRc\u003cT, K\u003e` was cloned instead\n  --\u003e $DIR/derive-implicit-bound-on-clone.rs:10:5\n   |\nLL |     x.clone()\n   |     ^\nhelp: `Clone` is not implemented because the some trait bounds could not be satisfied\n  --\u003e $DIR/derive-implicit-bound-on-clone.rs:5:19\n   |\nLL | #[derive(Clone)]\n   |          ----- in this derive macro expansion\nLL | struct ContainsRc\u003cT, K\u003e {\n   |                   ^  ^ derive introduces an implicit unsatisfied trait bound `K: Clone`\n   |                   |\n   |                   derive introduces an implicit unsatisfied trait bound `T: Clone`\n   \u003d help: consider manually implementing `Clone` to avoid the implict type parameter bounds\n```\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "3e4c194147f9fa9c50e566174ac7841995bc5a0f",
      "old_mode": 33188,
      "old_path": "compiler/rustc_hir_typeck/src/fn_ctxt/suggestions.rs",
      "new_id": "285288e87ee00e74cc94f7bfa73e04cfd87c31f8",
      "new_mode": 33188,
      "new_path": "compiler/rustc_hir_typeck/src/fn_ctxt/suggestions.rs"
    },
    {
      "type": "modify",
      "old_id": "301f3c3a458de1145aea8a39a54c0cca34cfa3a4",
      "old_mode": 33188,
      "old_path": "tests/ui/moves/assignment-of-clone-call-on-ref-due-to-missing-bound.current.stderr",
      "new_id": "5de99cc6ca6ae41a97a736773a698f250a8d6910",
      "new_mode": 33188,
      "new_path": "tests/ui/moves/assignment-of-clone-call-on-ref-due-to-missing-bound.current.stderr"
    },
    {
      "type": "modify",
      "old_id": "301f3c3a458de1145aea8a39a54c0cca34cfa3a4",
      "old_mode": 33188,
      "old_path": "tests/ui/moves/assignment-of-clone-call-on-ref-due-to-missing-bound.next.stderr",
      "new_id": "5de99cc6ca6ae41a97a736773a698f250a8d6910",
      "new_mode": 33188,
      "new_path": "tests/ui/moves/assignment-of-clone-call-on-ref-due-to-missing-bound.next.stderr"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "a4c9e88ef57659a4665fb4c51f0e6e4a439b6e3d",
      "new_mode": 33188,
      "new_path": "tests/ui/traits/derive-implicit-bound-on-clone.rs"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "0cec4ef7c6096820646ac1874d754e9ab135613b",
      "new_mode": 33188,
      "new_path": "tests/ui/traits/derive-implicit-bound-on-clone.stderr"
    }
  ]
}
