[pointer][invariant] Remove AliasingMapping, Inaccessible (#2301)#2386
Merged
[pointer][invariant] Remove AliasingMapping, Inaccessible (#2301)#2386
Conversation
We previously used `AliasingMapping`s and `Inaccessible` to model `UnsafeCell` agreement. This abuses the notion of a mapping since one doesn't ever actually want to change the aliasing of a pointer (and certainly not to `Inaccessible`) - really this was meant to model pointer casts which should never be performed. In addition to being an awkward fit, the presence of `Inaccessible` meant that code could not assume that any `Aliasing` invariant permitted reading, and so we had to add extra machinery to work around this. Future commits will use a different, simpler model for denoting `UnsafeCell` agreement or disagreement. While we're here, make `Read` slightly more permissive, implemented for `A: Aliasing, T: Immutable` rather than just `A: Reference, T: Immutable`. Makes progress on #1122, #1866 gherrit-pr-id: I1ac2ae177a235083e33b09fc848423220d3da042
Member
Author
|
Backporting #2301 |
jswrenn
approved these changes
Feb 25, 2025
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## v0.8.x #2386 +/- ##
=======================================
Coverage 87.81% 87.81%
=======================================
Files 17 17
Lines 6195 6195
=======================================
Hits 5440 5440
Misses 755 755 ☔ View full report in Codecov by Sentry. |
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.
We previously used
AliasingMappings andInaccessibleto modelUnsafeCellagreement. This abuses the notion of a mapping since one doesn't ever actually want to change the aliasing of a pointer (and certainly not toInaccessible) - really this was meant to model pointer casts which should never be performed. In addition to being an awkward fit, the presence ofInaccessiblemeant that code could not assume that anyAliasinginvariant permitted reading, and so we had to add extra machinery to work around this.Future commits will use a different, simpler model for denoting
UnsafeCellagreement or disagreement.While we're here, make
Readslightly more permissive, implemented forA: Aliasing, T: Immutablerather than justA: Reference, T: Immutable.Makes progress on #1122, #1866
gherrit-pr-id: I1ac2ae177a235083e33b09fc848423220d3da042