Repository navigation
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
Conversation
…view views, as every other record-view origin does (#3020)
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.
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 ofreturns 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
&Tpoints 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>):xnode.first_childparam 0Document.rootparam 0Both lines are now expectations of the
deep-debug-tool-testslane, so the two-declarations state cannot come back unnoticed.Also removed: one stray
WITH_TRACE_D184trace 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, anderr_d122_child_outlives_document,err_d122_walk_invalidates_siblings,err_c_facade_record_view_outlives_origin,err_c_facade_record_view_invalidated_by_lendstill 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-checkssurvey: all targets green.Closes #3020.