Skip to content

[pointer] Support generic invariant mapping #1896

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

Conversation

joshlf
Copy link
Member

@joshlf joshlf commented Oct 13, 2024

This commit adds a framework which supports encoding in the type system any I -> I mapping where I is any Invariant type. This permits us to make cast_unsized's return value smarter, and as a result, allows us to remove a lot of unsafe code.

Makes progress on #1122

@joshlf joshlf requested a review from jswrenn October 13, 2024 00:04
@joshlf
Copy link
Member Author

joshlf commented Oct 13, 2024

@jswrenn I'd love for you to take a crack at improving the ergonomics here.

@joshlf joshlf force-pushed the ptr-invariant-conversion-mapping branch 3 times, most recently from 5e5d01d to 231e3e3 Compare October 13, 2024 17:25
@joshlf joshlf force-pushed the ptr-opaque-invariants branch from 7c245c5 to 062b71a Compare October 13, 2024 17:25
@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.66%. Comparing base (ae43fce) to head (a991c04).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1896      +/-   ##
==========================================
- Coverage   87.67%   87.66%   -0.02%     
==========================================
  Files          17       17              
  Lines        5973     5967       -6     
==========================================
- Hits         5237     5231       -6     
  Misses        736      736              

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

@joshlf joshlf force-pushed the ptr-invariant-conversion-mapping branch from 231e3e3 to c19a3e9 Compare October 14, 2024 14:58
@joshlf joshlf force-pushed the ptr-opaque-invariants branch from 062b71a to 9eab1bd Compare October 14, 2024 14:58
@joshlf joshlf force-pushed the ptr-invariant-conversion-mapping branch from c19a3e9 to 148380c Compare October 14, 2024 15:24
@joshlf joshlf force-pushed the ptr-opaque-invariants branch from 9eab1bd to 39d2339 Compare October 14, 2024 15:24
@joshlf joshlf force-pushed the ptr-invariant-conversion-mapping branch from 148380c to d2919d9 Compare October 14, 2024 15:30
@joshlf joshlf force-pushed the ptr-opaque-invariants branch from 39d2339 to da4069e Compare October 14, 2024 15:30
@joshlf joshlf force-pushed the ptr-invariant-conversion-mapping branch from d2919d9 to 3928ed2 Compare October 14, 2024 17:14
@joshlf joshlf force-pushed the ptr-opaque-invariants branch from da4069e to 2172f24 Compare October 14, 2024 17:14
@joshlf joshlf force-pushed the ptr-invariant-conversion-mapping branch from 3928ed2 to 47de3c7 Compare October 14, 2024 17:34
@joshlf joshlf force-pushed the ptr-opaque-invariants branch from 2172f24 to 2a92f9f Compare October 14, 2024 17:34
@joshlf joshlf force-pushed the ptr-invariant-conversion-mapping branch from 47de3c7 to 2480958 Compare October 14, 2024 17:50
@joshlf joshlf force-pushed the ptr-opaque-invariants branch from 2a92f9f to 9e69c15 Compare October 14, 2024 17:50
@joshlf joshlf force-pushed the ptr-invariant-conversion-mapping branch from 2480958 to c3590eb Compare October 14, 2024 18:30
@joshlf joshlf force-pushed the ptr-opaque-invariants branch from 9e69c15 to 19875da Compare October 14, 2024 18:30
@joshlf joshlf force-pushed the ptr-invariant-conversion-mapping branch from c3590eb to d176d7a Compare October 14, 2024 19:03
@joshlf joshlf force-pushed the ptr-opaque-invariants branch from 19875da to 029d5d6 Compare October 14, 2024 19:03
Base automatically changed from ptr-opaque-invariants to main October 14, 2024 19:38
@joshlf joshlf force-pushed the ptr-invariant-conversion-mapping branch 4 times, most recently from 8451eff to e5494fe Compare October 14, 2024 21:35
@joshlf joshlf enabled auto-merge October 14, 2024 21:35
This commit adds a framework which supports encoding in the type system
any `I -> I` mapping where `I` is any `Invariant` type. This permits us
to make `cast_unsized`'s return value smarter, and as a result, allows
us to remove a lot of `unsafe` code.

Makes progress on #1122
@joshlf joshlf force-pushed the ptr-invariant-conversion-mapping branch from e5494fe to a991c04 Compare October 14, 2024 21:47
@joshlf joshlf added this pull request to the merge queue Oct 14, 2024
Merged via the queue into main with commit 0665b90 Oct 14, 2024
63 checks passed
@joshlf joshlf deleted the ptr-invariant-conversion-mapping branch October 14, 2024 22:18
github-merge-queue bot pushed a commit that referenced this pull request Feb 17, 2025
Now that #1122 is complete in #1896, `project` is redundant.

gherrit-pr-id: I15d38f2f1fffad82caa70ea6eb18dffcd6504495
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