Skip to content

[pointer] Match variance of references #1894

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

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
@joshlf joshlf force-pushed the ptr-invariant-file branch from 2f97c73 to 5f9ae12 Compare October 14, 2024 15:24
@joshlf joshlf force-pushed the ptr-variance-for-real branch from cf218f6 to 77362c9 Compare October 14, 2024 15:24
@joshlf joshlf force-pushed the ptr-invariant-file branch from 5f9ae12 to d765097 Compare October 14, 2024 15:30
@joshlf joshlf force-pushed the ptr-variance-for-real branch from 77362c9 to 25de780 Compare October 14, 2024 15:30
@joshlf joshlf force-pushed the ptr-invariant-file branch from d765097 to cad9c58 Compare October 14, 2024 17:14
@joshlf joshlf force-pushed the ptr-variance-for-real branch from 25de780 to d96d763 Compare October 14, 2024 17:14
@joshlf joshlf force-pushed the ptr-invariant-file branch from cad9c58 to 5870ed6 Compare October 14, 2024 17:34
@joshlf joshlf force-pushed the ptr-variance-for-real branch from d96d763 to 471f4a9 Compare October 14, 2024 17:34
@joshlf joshlf force-pushed the ptr-invariant-file branch from 5870ed6 to 6e8def9 Compare October 14, 2024 17:50
@joshlf joshlf force-pushed the ptr-variance-for-real branch from 471f4a9 to 25ddf05 Compare October 14, 2024 17:50
Base automatically changed from ptr-invariant-file to main October 14, 2024 18:28
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 force-pushed the ptr-variance-for-real branch from 25ddf05 to 87a434a Compare October 14, 2024 18:30
@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
google-pr-creation-bot pushed a commit to google-pr-creation-bot/zerocopy that referenced this pull request Feb 24, 2025
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 google#1839
@joshlf
Copy link
Member Author

joshlf commented Feb 24, 2025

Backporting in #2382

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