Repository navigation
D144 completed (a bare local observes), D145 ranges in pipelines (#2544), D142 lists of resource views - #2547
Merged
Merged
Conversation
added 4 commits
October 22, 2026 01:24
… `move pair` takes it apart Eric ruled (2026-10-22) that the one case the first D144 implementation kept on D115's implicit take — a bare local whose payload is a resource — observes like every other place. check_pattern's PAT_IDENT branch loses the exception, and pattern_binds_owned_value answers "nothing taken" for an identifier that observes its place (check_pattern's mark), so the let no longer marks the subject moved. The channel fixtures spell `let (tx, rx) = move pair`. behav_d144_bare_local_observes pins the observing destructure and the moved one; err_d144_bare_local_destructure_moves pins the refusal to move a part out of an observed pair. Decision record updated.
…range iterates on the left of |> A range is a sequence, so D142's rule covers it. std.collections gains RangeIter[T] (`impl[T: One + Ord] Iter[T]`), built by range_iter / range_iter_inclusive over the range's bounds; Sema dispatches `r.iter()` and a range on the left of `|>` to it through the same free-function implicit-iter record a slice uses (demand_free_fn_implicit_iter), and `for` keeps its counter loop. A range's `start` and `end` are read-only fields: Sema types them as the element and records the bound's index under the access node (range_bound_fields, D65); MIR projects fields 0 and 1 as the membership lowering does. `Range[T]` and `RangeInclusive[T]` resolve in a generic signature (they were "unknown type"), and a range argument binds T from its element. Delegated decision D145 recorded; spec words in §4.7 and §13.5; fixture behav_2544_range_in_pipeline.
…ral List[&T], §22.1 rules 3 and 7)
Eric ruled (2026-10-22: "fix it") that the ruling's letter — views of resources stay
views — means `collect[List]()` over resource views builds a `List[&T]`, not a
refusal. §22.1 rules 3 and 7 already describe that container: ephemeral, carrying
its views' origins, never a struct field or a global. Sema lifts the local-let
refusal of a `List[&T]` annotation (add_binding_view_deps already made such a
binding ephemeral); a push into `var vs = []` of a non-Copy view keeps the view as
the element (a Copy view still demands the value, D139); `collect` over resource
views dispatches to plain iter_collect with `T = &T`, in the method spelling and
the pipeline target; the value-building terminals keep their refusal. The escape
checks are the ones every ephemeral value has ("returned ephemeral value may
outlive its origin"). §3.3's "elements of heap containers" bullet is the sentence
left for Eric's wording.
Fixtures: behav_d142_resource_views_collect, err_d142_resource_views_escape;
err_second_class_reference_in_container now pins the struct-field case. D142
record amended.
…ruling err_destructure_then_project and err_match_local_consumed_then_used spelled the take implicitly; under D144 the bare local is observed and stays readable, so they now spell `move` and pin the consumed case (the second also had an enum spelled as a struct literal, masked by its expected failure). err_match_field_binds_owned pinned the D32 implicit-field-move error for a binding pattern on a field; D144 makes that binding observe, so it is now the behavior fixture behav_match_field_binds_observes.
added 2 commits
October 22, 2026 02:03
…l observes; the arm takes the handle on)
… (an enum of values is not Copy today, so the bare local observes; ceremony reported)
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.
D144 completed, D145 (ranges in pipelines, #2544), and D142's resource views
Three rulings from Eric's "1. do it. 2. yes 3. fix it 4. do it" (2026-10-22), one commit each:
D144, a bare local is a place too ("2. yes").
let (tx, rx) = pairobservespair; taking it apart islet (tx, rx) = move pair. The one exception the first implementation kept (D115's implicit take for a bare local holding a resource) is gone, andpattern_binds_owned_valueanswers "nothing taken" for an identifier that observes its place, so the let no longer marks the subject moved. The channel fixtures spellmove pair;behav_d144_bare_local_observesanderr_d144_bare_local_destructure_movespin it; the D144 record is updated.D145 (delegated), a range has
iter()and its bounds arestartandend(#2544, "3. fix it"). A range is a sequence, so D142's rule covers it:(0..n) |> map(it * 2)iterates. std'sRangeIter[T](impl[T: One + Ord] Iter[T]) is built byrange_iter/range_iter_inclusiveover the bounds; Sema dispatchesr.iter()and a range on the left of|>through the free-function implicit-iter record a slice uses;forkeeps its counter loop.start/endare read-only fields (Sema records the bound's index for MIR, D65).Range[T]in a generic signature resolves and bindsT. Spec words §4.7, §13.5; record D145.D142, collecting views of resources builds a list of views ("3. fix it"). The ruling's letter — views of resources stay views — means
collect[List]()over them is an ephemeralList[&T], which §22.1 rules 3 and 7 already describe. A localList[&T]is no longer refused;var vs = []fed a resource view is one;collectover resource views is plainiter_collectwithT = &T; the escape checks are the ones every ephemeral value has (err_d142_resource_views_escape). A struct field or a global of one stays refused (err_second_class_reference_in_containernow pins the field). §3.3's bullet "elements of heap containers" is the one sentence that still says otherwise; its amendment is Eric's (proposed words in the stack's report).Closes #2544.