)]}'
{
  "commit": "65bcac45b3d8a8b2126e5cc844cf6fff5795d32a",
  "tree": "372467ec6a896b6102bc7b330650df6e3e6fd5bb",
  "parents": [
    "ae45457594a670c59cd4d5591eaa243d9a3d44d5",
    "7089725ce269380f301eebb84ed3be534b43b0d7"
  ],
  "author": {
    "name": "bors",
    "email": "bors@rust-lang.org",
    "time": "Fri Aug 07 10:00:49 2026 +0000"
  },
  "committer": {
    "name": "bors",
    "email": "bors@rust-lang.org",
    "time": "Fri Aug 07 10:00:49 2026 +0000"
  },
  "message": "Auto merge of #160479 - nnethercote:opt-try_evaluate_obligations, r\u003djdonszelmann\n\nOptimize `try_evaluate_obligations`\n\n\n\nThis function is very sub-optimal, perf-wise: it takes `self.obligations.pending` (with `mem::take`) and iterates over the elements, checking each one. But most of the time no progress is made and all the obligations get pushed back onto `self.obligations.pending`. This drain + reconstruct approach is very expensive, mostly because the new `pending` vec is built by pushing one element at a time, which requires repeated reallocations. And this vec can have thousands of elements in it, in extreme cases.\r\n\r\nAlso, `obligation` and `stalled_on` get passed by value to `evaluate_root_goal` (`obligation` as `goal`), which then usually passes the values back in the `GoalEvaluation` which is immediately deconstructed. This is a lot of wasted value moves.\r\n\r\nThis commit optimizes things in two ways.\r\n\r\n- It prioritizes the hot path. This involves checking in advance if there is an inspector (usually not) and adding `goal_remains_stalled` which takes `stalled_on` by reference. This hot path avoids all the value moves and `GoalEvaluation` construction/deconstruction and gets to the very common \"nothing needed to be done\" outcome as quickly as possible.\r\n\r\n- It uses `retain_mut` to update `self.obligations.pending`. This requires some adjustments (e.g. handling recursion via the `overflowed` flag with some cleanup code after the `retain_mut` call, and cloning obligations in the error cases).\r\n\r\nr? @lcnr\r\ncc @jdonszelmann @WaffleLapkin ",
  "tree_diff": []
}
