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] Make invariants opaque, more ergonomic #1895

Merged
merged 1 commit into from
Oct 14, 2024
Merged

Conversation

joshlf
Copy link
Member

@joshlf joshlf commented Oct 12, 2024

Closes #1876

@joshlf joshlf requested a review from jswrenn October 12, 2024 22:51
@joshlf joshlf enabled auto-merge October 12, 2024 22:51
@joshlf joshlf changed the base branch from main to ptr-variance-for-real October 12, 2024 22:51
@joshlf joshlf changed the title Ptr opaque invariants [pointer] Make invariants opaque, more ergonomic Oct 12, 2024
auto-merge was automatically disabled October 12, 2024 22:51

Merge commits are not allowed on this repository

@joshlf
Copy link
Member Author

joshlf commented Oct 12, 2024

@jswrenn I didn't update any methods which modify two of three invariants. Any galaxy brain ideas on how to make those ergonomic?

The best I could come up with was yet another set of associated types e.g.:

type RetainAliasing<A: Alignment, V: Validity> = ...;

...but that's not forwards-compatible with adding new invariant types.

src/pointer/ptr.rs Outdated Show resolved Hide resolved
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 87.64%. Comparing base (51475bd) to head (029d5d6).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1895      +/-   ##
==========================================
- Coverage   87.65%   87.64%   -0.02%     
==========================================
  Files          17       17              
  Lines        5964     5956       -8     
==========================================
- Hits         5228     5220       -8     
  Misses        736      736              

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

@joshlf joshlf added this pull request to the merge queue Oct 14, 2024
Merged via the queue into main with commit f80a65d Oct 14, 2024
63 checks passed
@joshlf joshlf deleted the ptr-opaque-invariants branch October 14, 2024 19:38
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.

Make Ptr invariants opaque and more ergonomic
3 participants