-
Notifications
You must be signed in to change notification settings - Fork 13.9k
Fix UnwrapUnsafeBinder handling in borrow conflict detection #147796
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Replace `todo!()` with proper conflict analysis for `UnwrapUnsafeBinder` projection elements in `places_conflict.rs`. `UnwrapUnsafeBinder` is treated as a transparent wrapper that doesn't affect place aliasing, returning `EqualOrDisjoint` when both projections match.
|
r? @madsmtm |
|
Requested reviewer is already assigned to this pull request. Please choose another assignee. |
|
This is probably too far outside my area of expertise r? compiler-errors (since you authored #130514) |
|
|
|
r? lcnr |
|
Was this PR AI generated? |
|
This definitely needs an added @rustbot author |
|
Reminder, once the PR becomes ready for a review, use |
Summary
Replace
todo!()with proper conflict analysis forUnwrapUnsafeBinderprojection elements inplaces_conflict.rs.UnwrapUnsafeBinderis treated as a transparent wrapper that doesn't affect place aliasing, returningEqualOrDisjointwhen both projections match.Changes
place_projection_conflict()to handleUnwrapUnsafeBinderprojections correctlyTesting
Test Results
Verification
The test correctly identifies borrow conflicts when the same place is borrowed mutably multiple times, demonstrating that
UnwrapUnsafeBinderis properly handled as a transparent projection that preserves aliasing semantics.