)]}'
{
  "commit": "b8ce2c15227679e60c2e43af45f968f94b880564",
  "tree": "64d78022036be319e4d041868b79815e3040ea3e",
  "parents": [
    "b9ddc4513c37df862800a3afe1e47c4f2c1973af"
  ],
  "author": {
    "name": "Devin Jeanpierre",
    "email": "jeanpierreda@google.com",
    "time": "Wed Jul 13 10:34:01 2022 -0700"
  },
  "committer": {
    "name": "Copybara-Service",
    "email": "copybara-worker@google.com",
    "time": "Wed Jul 13 10:34:35 2022 -0700"
  },
  "message": "Return `!Unpin` objects by value.\n\nTo reduce complexity of this change, I avoided two obvious optimizations:\n\n1. I chose to use the same scheme for both trivially relocatable and non-trivially-relocatable !Unpin values. I _could_ have used a different scheme for trivially relocatable ones, which avoided the extra thunk -- I opted to instead have that as a TODO, as it\u0027s a relatively simple extension that we would only do for performance.\n\n2. This CL always generates a thunk for such functions. Indeed, my initial attempt at a CL involved adding a \"pretend\" parameter representing the output return slot, inside the C++ AST visitor, so that we could call the real underlying function directly. However, this turns out to be difficult to do right: aside from trivial concerns like \"where do we get a lifetime from?\", there\u0027s a more significant concern of, well, it\u0027s an ABI implementation detail that clang actually does not expose anywhere except during codegen, and so it\u0027s really tricky to get right. Instead, I opted for, uh, just creating a thunk every time. And the thunk can accept an extra out parameter in the API. This is *substantially* less code/complexity, at lower risk. (Kudos to Martin for pushing back and suggesting this!)\n\nWorth making special mention that the return value of operator\u003d is treated specially, as it is discarded (and must therefore be eagerly evaluated). That was a decision made earlier that we may want to revisit for higher fidelity, but for now I\u0027m leaving it as is. (It\u0027s not yet implemented for !Unpin types, so that bit is slightly dead code.)\n\nPiperOrigin-RevId: 460750558\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "2996dd95d0de596c3d0d9655cde39cbdee5899ff",
      "old_mode": 33188,
      "old_path": "rs_bindings_from_cc/importers/function.cc",
      "new_id": "a70505510705db76b934fa5914b21544777e470d",
      "new_mode": 33188,
      "new_path": "rs_bindings_from_cc/importers/function.cc"
    },
    {
      "type": "modify",
      "old_id": "5faf908b5cd6532e4b0b48b0b255e3e911f7aea6",
      "old_mode": 33188,
      "old_path": "rs_bindings_from_cc/src_code_gen.rs",
      "new_id": "c5e2df0af68421cd532767216624a43b87d9dded",
      "new_mode": 33188,
      "new_path": "rs_bindings_from_cc/src_code_gen.rs"
    },
    {
      "type": "modify",
      "old_id": "b35999970d8cb5250269acf96bf3434fe4bf3a91",
      "old_mode": 33188,
      "old_path": "rs_bindings_from_cc/test/golden/namespace_rs_api.rs",
      "new_id": "5087794992b6fac7c040a93589c0dbd05fd3b505",
      "new_mode": 33188,
      "new_path": "rs_bindings_from_cc/test/golden/namespace_rs_api.rs"
    },
    {
      "type": "modify",
      "old_id": "06bbcb916205d7a972a2a9a04198b77cfa706a0b",
      "old_mode": 33188,
      "old_path": "rs_bindings_from_cc/test/golden/namespace_rs_api_impl.cc",
      "new_id": "1f1fa26ea5d8ec2a0ce7303387619daa960d6c3b",
      "new_mode": 33188,
      "new_path": "rs_bindings_from_cc/test/golden/namespace_rs_api_impl.cc"
    },
    {
      "type": "modify",
      "old_id": "9f14b9efe63bc96df109e41919f02001a425f7a9",
      "old_mode": 33188,
      "old_path": "rs_bindings_from_cc/test/golden/nontrivial_type.h",
      "new_id": "91ab2617a30186ee7a5be4f21f0cb5ed3b9ce761",
      "new_mode": 33188,
      "new_path": "rs_bindings_from_cc/test/golden/nontrivial_type.h"
    },
    {
      "type": "modify",
      "old_id": "4cf96d5fdb55a7a9524d94a63f98b131aa5c5cd0",
      "old_mode": 33188,
      "old_path": "rs_bindings_from_cc/test/golden/nontrivial_type_rs_api.rs",
      "new_id": "6c4c0754c01d5b31a2182c6882e38e882b158c14",
      "new_mode": 33188,
      "new_path": "rs_bindings_from_cc/test/golden/nontrivial_type_rs_api.rs"
    },
    {
      "type": "modify",
      "old_id": "daa1209ac857b65706e4ce04704d6fabdf9d0aa7",
      "old_mode": 33188,
      "old_path": "rs_bindings_from_cc/test/golden/nontrivial_type_rs_api_impl.cc",
      "new_id": "4e7f8480f73b026ab964b1afd129608548f3eaae",
      "new_mode": 33188,
      "new_path": "rs_bindings_from_cc/test/golden/nontrivial_type_rs_api_impl.cc"
    },
    {
      "type": "modify",
      "old_id": "f745a4b97d909d9f078c2100ff25703127022e7c",
      "old_mode": 33188,
      "old_path": "rs_bindings_from_cc/test/golden/templates_rs_api.rs",
      "new_id": "8272ce6897d29bd355a69b8b5d1b95c760210ebe",
      "new_mode": 33188,
      "new_path": "rs_bindings_from_cc/test/golden/templates_rs_api.rs"
    },
    {
      "type": "modify",
      "old_id": "eecc1c28abf84a6cac51dc2a4f0b549f760578f9",
      "old_mode": 33188,
      "old_path": "rs_bindings_from_cc/test/golden/templates_rs_api_impl.cc",
      "new_id": "45fdfb414eedee08248dada9fd0afdfa99b2a9d4",
      "new_mode": 33188,
      "new_path": "rs_bindings_from_cc/test/golden/templates_rs_api_impl.cc"
    },
    {
      "type": "modify",
      "old_id": "f2438cba8458bf5d7baf2fab867dda2a5baf801e",
      "old_mode": 33188,
      "old_path": "rs_bindings_from_cc/test/struct/nonunpin/nonunpin.h",
      "new_id": "9fa5ce8f76c3d8d74349acef43a02d42d7919c69",
      "new_mode": 33188,
      "new_path": "rs_bindings_from_cc/test/struct/nonunpin/nonunpin.h"
    },
    {
      "type": "modify",
      "old_id": "ebffa3b327c8c0ec34b59a447882388fc64206af",
      "old_mode": 33188,
      "old_path": "rs_bindings_from_cc/test/struct/nonunpin/nonunpin_test.rs",
      "new_id": "1f123ea52120bbe59bbefdabc8d1c6ac4fceefcd",
      "new_mode": 33188,
      "new_path": "rs_bindings_from_cc/test/struct/nonunpin/nonunpin_test.rs"
    },
    {
      "type": "modify",
      "old_id": "853ba256855aa6f77ddfe3bf110daa9207bdb0e7",
      "old_mode": 33188,
      "old_path": "rs_bindings_from_cc/test/struct/operators/operators.h",
      "new_id": "844972adafc65312f74b28caab97ff72611689f1",
      "new_mode": 33188,
      "new_path": "rs_bindings_from_cc/test/struct/operators/operators.h"
    }
  ]
}
