Repository navigation
Lower field projections through temporary pointers - #1627
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1188871b44
ℹ️ 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".
1188871 to
7b64045
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7b64045df0
ℹ️ 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".
The lowering and type checking for places reached through a temporary pointer landed on master (#1633, #1634). Keep this branch's extra coverage on top of it: - `temporary_pointer_field.fe` exercises reads, writes, compound assignment and explicit `mut`/`ref` borrows of fields reached through pointer-returning calls such as `orders.ptr_at(0).n`, including chained `ptr_at` calls and pointer fields of temporaries. - `borrow_custom_index_through_pointer.fe` pins that a built-in array element below a temporary pointer is borrowable, while a custom `Index` call below one is still rejected as a non-place.
7b64045 to
43873b5
Compare
A field of a pointer-valued temporary, such as
orders.ptr_at(0).n, has no binding-basedPlace. Semantic lowering fell back to a value projection of the pointer itself, which normalization rejected as an invalid projection (internal borrow checking error 16-0004), and type checking rejected assignments to it as not assignable.try_lower_placeresolves the field likePlace::from_expr_in_bodydoes and dereferences the pointer temporary (or a pointer field of a temporary-rooted place) before selecting the field.*ptrtargets.