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] Match variance of references #1894

Merged
merged 1 commit into from
Oct 14, 2024
Merged

[pointer] Match variance of references #1894

merged 1 commit into from
Oct 14, 2024

Conversation

joshlf
Copy link
Member

@joshlf joshlf commented Oct 12, 2024

When the aliasing mode is Any, Ptr<'a, T> is invariant in 'a and T. When the aliasing mode is Shared or Exclusive, Ptr has the same variance as &'a T and &'a mut T respectively.

Makes progress on #1839

@joshlf joshlf requested a review from jswrenn October 12, 2024 22:32
@joshlf
Copy link
Member Author

joshlf commented Oct 12, 2024

@jswrenn Any ideas on how to test this?

@codecov-commenter
Copy link

codecov-commenter commented Oct 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 87.65%. Comparing base (ca9243f) to head (87a434a).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1894   +/-   ##
=======================================
  Coverage   87.65%   87.65%           
=======================================
  Files          17       17           
  Lines        5964     5964           
=======================================
  Hits         5228     5228           
  Misses        736      736           

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

@joshlf joshlf changed the base branch from ptr-inner to ptr-invariant-file October 14, 2024 15:01
When the aliasing mode is `Any`, `Ptr<'a, T>` is invariant in `'a` and
`T`. When the aliasing mode is `Shared` or `Exclusive`, `Ptr` has the
same variance as `&'a T` and `&'a mut T` respectively.

Makes progress on #1839
@joshlf joshlf enabled auto-merge October 14, 2024 18:30
@joshlf joshlf added this pull request to the merge queue Oct 14, 2024
Merged via the queue into main with commit 51475bd Oct 14, 2024
63 checks passed
@joshlf joshlf deleted the ptr-variance-for-real branch October 14, 2024 19:02
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