Skip to content
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

[pointer] Simplify AliasingSafe, rename to Read (#1908) #2383

Merged
merged 1 commit into from
Feb 25, 2025
Merged

Conversation

joshlf
Copy link
Member

@joshlf joshlf commented Feb 24, 2025

AliasingSafe is really about whether a pointer permits unsynchronized reads - either because the referent contains no UnsafeCells or because the aliasing mode is Exclusive. Previously, AliasingSafe was not named consistent with this meaning, and was a function of a pair of types rather than of a single type. This commit fixes both oversights.

While we're here, we also add Read bounds in some places, allowing us to simplify many safety comments.

gherrit-pr-id: I88b9101a614459af3b062dc3d38142ba76427f34

`AliasingSafe` is really about whether a pointer permits unsynchronized
reads - either because the referent contains no `UnsafeCell`s or because
the aliasing mode is `Exclusive`. Previously, `AliasingSafe` was not
named consistent with this meaning, and was a function of a *pair* of
types rather than of a single type. This commit fixes both oversights.

While we're here, we also add `Read` bounds in some places, allowing us
to simplify many safety comments.

gherrit-pr-id: I88b9101a614459af3b062dc3d38142ba76427f34
@joshlf joshlf requested a review from jswrenn February 24, 2025 23:41
@joshlf joshlf enabled auto-merge February 24, 2025 23:41
@joshlf
Copy link
Member Author

joshlf commented Feb 24, 2025

Backporting #1908

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 87.81%. Comparing base (6ebdffb) to head (e09713e).

Additional details and impacted files
@@            Coverage Diff             @@
##           v0.8.x    #2383      +/-   ##
==========================================
+ Coverage   87.78%   87.81%   +0.02%     
==========================================
  Files          17       17              
  Lines        6183     6195      +12     
==========================================
+ Hits         5428     5440      +12     
  Misses        755      755              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Merged via the queue into v0.8.x with commit fb00e98 Feb 25, 2025
87 checks passed
@joshlf joshlf deleted the v0.8.x-1908 branch February 25, 2025 00:17
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.

3 participants