Repository navigation
D44: map traversal observes; keys/values/iter are view iterators; HashSet iterates; comprehensions over maps (#2183, #2184, #2185) - #2195
Merged
Conversation
added 2 commits
October 5, 2026 13:23
…rators; for and comprehensions over a map or set step iter() (#2183, #2184, #2185) HashMap, HashSet and BTreeMap traverse through MapIter, MapKeys, MapValues and SetIter: concrete ephemeral iterators over a view of the collection whose items are views into it, so nothing is copied out (§2.3) and every iterator adapter applies (m.keys() |> map(it.clone()) |> collect[Vec]()). The built-in snapshot intrinsics (MAP_KEYS/VALUES/ITEMS, the cloning lowering, with_hashmap_*_out callers) are gone, and items() with them; a HashMap is walked through std-only slot accessors. The .map(f) adapter is MappedIter: MapIter is the spec's name for the traversal. HashSet is iterable (#2183); a comprehension clause over a map, set or BTreeMap steps the collection's iter() (#2185). Found on the way, fixed here: - #2187: a view returned through a match arm's or let-else's pattern binding lost its parameter origin, so a use-after-free compiled. The tail view's parameter effects are now published in scope; the origin walkers read each match arm's frozen facts; a place reached through a view of a view (and a view payload bound out of a by-value subject) views what the inner view views; record_transparent_view_origins reads a node's storage before resetting it. - #2188: reflecting a generic instance resolved its template by a name visible from the current module; a private generic enum reached through another module's type ICEd. It reads the instance's recorded template. - #2189: indexing through &&Vec[T] peels every reference. - #2190: collect[String]() frees its staging Vec. The transferring traversals (into_iter, into_keys, into_values, drain) are #2191.
ehartford
force-pushed
the
d44-map-views
branch
from
October 5, 2026 20:23
44969fd to
a21e326
Compare
Contributor
Author
|
Battery GREEN on the stack top a21e326 (stack #2196): gate rc=0 (102s), uat rc=0 (73s), battery-checks rc=0 (245s); green evidence published. |
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.
Layer 5 of stack #2196.
HashMap, HashSet and BTreeMap traverse through MapIter/MapKeys/MapValues/SetIter: ephemeral view iterators, so
m.keys() |> map(it.clone()) |> collect[Vec]()is the owned collection D44 names. The built-in snapshot intrinsics and items() are gone. The.map(f)adapter is renamed MappedIter.Fixed on the way:
Transfers (into_iter, into_keys, into_values, drain) are #2191.
Closes #2183, #2184, #2185, #2187, #2188, #2189, #2190.