Skip to content

A method a record view hosts declares its result as viewing what the view views, as every other record-view origin does (#3020) - #3585

Merged
ehartford merged 1 commit into
mainfrom
record-views-through
Nov 24, 2026
Merged

ehartford merged 1 commit into
mainfrom
record-views-through

Conversation

@ehartford

Copy link
Copy Markdown
Contributor

Before. A method hosted on a record view (n.first_child()) declared its result as viewing the receiver's own storage, while the second origin of returns borrow T from params 0, 1 (D187) declared "through what the parameter views". Two declarations for one meaning; the receiver came out right only because the call site treats a receiver borrowed in place specially.

After. The receiver of a record-view-hosted method is declared "through" as well: a record view &T points at C memory its record's origin owns, so a result borrowed through any view parameter views what that view views.

What stays, and why. The method a resource hosts (d.root()) keeps "of storage": its parameter is the owner, not a view. I first changed that site too and three fixtures that must refuse were accepted or named the wrong origin; the compiler's own explanation showed why, and the change went back.

The compiler states the difference itself (with analyze … explain:origin:<fn>):

before after
xnode.first_child param 0 from its own storage only through what it views
Document.root param 0 from its own storage from its own storage

Both lines are now expectations of the deep-debug-tool-tests lane, so the two-declarations state cannot come back unnoticed.

Also removed: one stray WITH_TRACE_D184 trace line in SemaCheck that no document names.

Evidence at 423a5b0. The 17 record-view fixtures pass (behav_d187_borrow_from_two_params, behav_d122_borrow_through_borrow, and err_d122_child_outlives_document, err_d122_walk_invalidates_siblings, err_c_facade_record_view_outlives_origin, err_c_facade_record_view_invalidated_by_lend still refuse with the same text); :deep-debug-tool-tests, :behavior-tests, pre-checks green; battery green; linux-aarch64 container leg green (:deep-debug-tool-tests); :release-checks survey: all targets green.

Closes #3020.

…view views, as every other record-view origin does (#3020)
@ehartford
ehartford merged commit 44fd0bd into main Nov 24, 2026
@ehartford
ehartford deleted the record-views-through branch November 24, 2026 09:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Record views: declare every view origin as through, self included (D122/D187 use two declarations for one meaning)

1 participant