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] Update requirements for zero-sized types #1614

Merged
merged 1 commit into from
Sep 7, 2024
Merged

[pointer] Update requirements for zero-sized types #1614

merged 1 commit into from
Sep 7, 2024

Conversation

joshlf
Copy link
Member

@joshlf joshlf commented Sep 7, 2024

Now that [1] is completed, zero-sized accesses no longer require provenance. Per [2], zero-sized references are no longer required to be dereferenceable, and so may not carry provenance.

This commit updates Ptr's invariants to not require provenance or a valid allocation when its referent is zero-sized.

[1] rust-lang/rust#117945
[2] rust-lang/rust#125021

Closes #874

Now that [1] is completed, zero-sized accesses no longer require
provenance. Per [2], zero-sized references are no longer required to be
dereferenceable, and so may not carry provenance.

This commit updates `Ptr`'s invariants to not require provenance or a
valid allocation when its referent is zero-sized.

[1] rust-lang/rust#117945
[2] rust-lang/rust#125021

Closes #874
@joshlf joshlf requested a review from jswrenn September 7, 2024 20:37
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 87.77%. Comparing base (35a219b) to head (026d462).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1614      +/-   ##
==========================================
+ Coverage   87.70%   87.77%   +0.06%     
==========================================
  Files          15       15              
  Lines        5565     5594      +29     
==========================================
+ Hits         4881     4910      +29     
  Misses        684      684              

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

@jswrenn jswrenn added this pull request to the merge queue Sep 7, 2024
Merged via the queue into main with commit d66705a Sep 7, 2024
74 checks passed
@jswrenn jswrenn deleted the zst-ptr branch September 7, 2024 21:06
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.

Ptr type needs to handle zero-sized types
3 participants