Assert projection call bases are evaluated once - #4145
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Review limit reached
Next review available in: 24 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
⏭️ Performance benchmarks were skippedPerf benchmarks (CodSpeed) are opt-in on pull requests — they no longer run on every push. They always run automatically after merge to To run them on this PR, do any of the following, then push a commit (or re-run CI):
|
Binary size checks passed✅ 7 passed
Generated by |
Summary
Store.require()Why
This is a test-only follow-up to the unresolved review on #4140. The original regression used a pure
require()method, so it could not detect duplicate evaluation of the projection base.Impact
No production behavior changes. The strengthened regression now guards both correct nested assignment and exactly-once evaluation.
Validation
cargo nextest run -p bex_vm --test projection_dest_calls method_call_result_can_be_the_base_of_nested_field_assignmentcargo nextest run -p bex_vm --test projection_dest_callscargo fmt --all --checkgit diff --checkNote
Low Risk
Only updates an integration test; no compiler, MIR, or runtime behavior changes.
Overview
Test-only change to
method_call_result_can_be_the_base_of_nested_field_assignmentinprojection_dest_calls.rs.The nested assignment
store.require().info.title = "triage"still must mutate the right field; the test now also proves the projection base is evaluated exactly once.Storegains acallscounter incremented insiderequire(), andmainassertsstore.calls == 1in addition to the title check. A purerequire()that only returnedself.recordcould pass even if MIR evaluated the call twice.Reviewed by Cursor Bugbot for commit 7f02714. Bugbot is set up for automated code reviews on this repo. Configure here.