Skip to content

Fix noesc borrow - #1534

Open
sbillig wants to merge 3 commits into
argotorg:masterfrom
sbillig:fix-noesc-borrow
Open

Fix noesc borrow#1534
sbillig wants to merge 3 commits into
argotorg:masterfrom
sbillig:fix-noesc-borrow

Conversation

@sbillig

@sbillig sbillig commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator

Fix borrow checking for aggregates containing ref or mut values across function calls.

This preserves borrow identity through aggregate construction, projection, returns, and stores; handles array overwrites and reborrows precisely; and distinguishes storage views from actual borrows.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4e33393151

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +803 to +805
LayoutBackingProjection::Index(Some(_)),
LayoutBackingProjection::Index(None)
| LayoutBackingProjection::IndexFamily(_)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Exclude exact overwrites from symbolic family loans

When an array of borrow-containing elements comes from a call, its held loan is represented by an IndexFamily; on values[0] = replacement, this exception retains that symbolic loan alongside the new exact entry. effective_loans subsequently expands the retained loan to every original target without applying definite_overrides, so the overwritten referent remains falsely borrowed—for example, forwarding [Wrap; 2], replacing slot 0, and then borrowing the original slot-0 value reports a conflict. Preserve the family loan for sibling indices, but shadow its overwritten member when computing active targets.

Useful? React with 👍 / 👎.

Comment thread crates/hir/src/analysis/semantic/borrowck/check.rs Outdated
Comment thread crates/hir/src/analysis/semantic/borrowck/check.rs
@sbillig

sbillig commented Aug 1, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 90948911b2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread crates/hir/src/analysis/semantic/borrowck/check.rs Outdated
Comment thread crates/hir/src/analysis/semantic/borrowck/check.rs Outdated
@sbillig

sbillig commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep them coming!

Reviewed commit: c6a417f8ac

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

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.

1 participant