Repository navigation
Conversation
…emporary drops; a join of a view into a temporary is one too A `let` of an `if` or `match` whose arm views its own statement temporary (`why.slice(2, n).trim()`) takes the str (D179), but MirLower copied the pointee once at the join, after the arm's temporary frame had dropped the slice: the binding read freed memory (the right length, blank bytes; WITH_ALLOC_NO_REUSE=1 showed the text). lower_contextual_copy_adjustment now hands an if/match to its arms (copy_out_join_node), which copy out inside their frames; the result local is the owned type; nested joins propagate. Sema's §21.1 checker never marked the join itself, so a `-> &str` function returning such a join was accepted: resolve_contextual_join and record_transparent_view_origins_from_nodes carry expr_view_into_temporary from any arm or source, and the return is refused with the existing words. Fixtures: behav_3165 (every row of the matrix in #3165, incl. a block arm, a nested join and a match), err_3165 (the returned join).
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.
Stack created with GitHub Stacks CLI • Give Feedback 💬