Repository navigation
chore(lane): daily maintenance 2026-11-04 - #141
Merged
Merged
Conversation
…e panics Input: a VecMap whose key type has a Clone that panics; a vacant entry_ref(&k).or_insert(v) is caught with catch_unwind, then a new key is inserted through entry(). Wrong output: EntryRef::or_insert_with_key pushed the value before cloning the key, so the panicking clone left one value with no key. Every key inserted afterwards paired with its predecessor's value: iter() yielded [(1, "one"), (2, "lost")]. Expected output: [(1, "one"), (2, "two")]. The type documents itself as a drop-in replacement for std::collections::HashMap, whose entry API leaves the map unchanged when caller code panics mid-insert. The fix builds the value and the cloned key before pushing either; successful inserts are unchanged (default still runs first, the key is still cloned once). Test: vecmap_tests::test_entry_ref_panicking_key_clone_leaves_map_unchanged fails on origin/master with the output above and passes now. Re-run: cargo test -p moon-collections panicking Reviewed by Codex (verdict: agree).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hunt
Crate:
moon-collections(VecMap).VecMapwhose key type has aClonethat panics; a vacantentry_ref(&k).or_insert(v)is caught withcatch_unwind, then a new key is inserted throughentry().EntryRef::or_insert_with_keypushed the value before cloning the key, so the panicking clone left one value with no key. Every later key paired with its predecessor's value:iter()yielded[(1, "one"), (2, "lost")].[(1, "one"), (2, "two")].VecMapdocuments itself as a drop-in replacement forstd::collections::HashMap, whose entry API leaves the map unchanged when caller code panics mid-insert.vecmap_tests::test_entry_ref_panicking_key_clone_leaves_map_unchangedfails onorigin/masterwith the output above and passes now. Re-run:cargo test -p moon-collections panicking.Quiet jobs
auto-foundissues (TreeMap::remove_range duplicates entries when end precedes start #127, GPU canvas text error fallback replays a cached frame with polychrome sprites #129) carryneeds-human.crates/moon-gpui/README.md,CONTRIBUTING.md,crates/moon-ui-components/src/highlighter/languages/rust/README.mdandcrates/moon-ui-gallery/README.mdmatch the code;docs/GPU_CANVAS_TEXT_API.mdanddocs/MOON_PATCH_QUEUE.mdwere skipped (no commits to the code they describe since their own last commit).