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

Merged
merged 1 commit into from
Oct 14, 2024
Merged

Conversation

joshlf
Copy link
Member

@joshlf joshlf commented Oct 14, 2024

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.

@joshlf joshlf requested a review from jswrenn October 14, 2024 19:34
@joshlf joshlf force-pushed the aliasing-safety-is-read branch from 329d0c2 to a982e1d Compare October 14, 2024 19:35
@joshlf joshlf enabled auto-merge October 14, 2024 19:35
@joshlf joshlf force-pushed the aliasing-safety-is-read branch 2 times, most recently from d510cff to c938064 Compare October 14, 2024 19:44
@codecov-commenter
Copy link

codecov-commenter commented Oct 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 87.66%. Comparing base (f80a65d) to head (3e67424).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1908      +/-   ##
==========================================
+ Coverage   87.64%   87.66%   +0.02%     
==========================================
  Files          17       17              
  Lines        5956     5968      +12     
==========================================
+ Hits         5220     5232      +12     
  Misses        736      736              

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

`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.
@joshlf joshlf force-pushed the aliasing-safety-is-read branch from c938064 to 3e67424 Compare October 14, 2024 19:57
@joshlf joshlf added this pull request to the merge queue Oct 14, 2024
Merged via the queue into main with commit 85a12e2 Oct 14, 2024
63 checks passed
@joshlf joshlf deleted the aliasing-safety-is-read branch October 14, 2024 20:28
joshlf added a commit that referenced this pull request Feb 24, 2025
`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
Copy link
Member Author

joshlf commented Feb 24, 2025

Backporting in #2383

github-merge-queue bot pushed a commit that referenced this pull request Feb 24, 2025
`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
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