-
Notifications
You must be signed in to change notification settings - Fork 137
Permit shrinking transmutes in transmute machinery #2912
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
base: main
Are you sure you want to change the base?
Conversation
Summary of ChangesHello @joshlf, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request refines the Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
a4ef307 to
591b556
Compare
8529fd1 to
5b89e27
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request refactors the transmutation machinery to enable future support for shrinking transmutes. The core change is relaxing the bound on SizeEq::CastFrom from CastExact to Cast, which allows it to be used for non-size-preserving casts. To maintain safety, existing code that relied on the implicit size-equality guarantee of SizeEq has been updated to explicitly require CastExact. The changes are well-structured, consistent, and the documentation has been updated accordingly. This is a good step towards more flexible transmutation capabilities. I have no further comments.
591b556 to
62ea699
Compare
5b89e27 to
5635968
Compare
62ea699 to
522141c
Compare
5635968 to
46f2fd0
Compare
522141c to
f0a5b8c
Compare
abc0fe4 to
4f2892d
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2912 +/- ##
=======================================
Coverage 91.31% 91.31%
=======================================
Files 20 20
Lines 5897 5897
=======================================
Hits 5385 5385
Misses 512 512 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
77aedb3 to
a86e3dd
Compare
f0a5b8c to
4cb7174
Compare
a86e3dd to
7a46add
Compare
7a46add to
975631d
Compare
b1116a3 to
15386c4
Compare
15386c4 to
8fa19c4
Compare
97a08f6 to
857d03c
Compare
43a76ea to
c7676f9
Compare
857d03c to
3e346c5
Compare
3e346c5 to
b995fc0
Compare
5f0ebe0 to
fc1ff83
Compare
c5bf143 to
0744864
Compare
fc1ff83 to
918103f
Compare
918103f to
565194b
Compare
0744864 to
1371b00
Compare
565194b to
fec3c4e
Compare
bdeb4fe to
8e47081
Compare
fec3c4e to
0bba9e9
Compare
8e47081 to
e514dc5
Compare
0bba9e9 to
3852df9
Compare
05ef45a to
41d3040
Compare
b3dc714 to
bdba77b
Compare
0516778 to
28a38ee
Compare
bdba77b to
2bb0c47
Compare
With this change, some `TryTransmuteFromPtr` impls become conditionally sound – specifically, they are sound for size-preserving casts, but not for size-shrinking casts. In order to ensure they remain sound, we make the cast a type parameter on `TryTransmuteFromPtr`, which allows us to add the appropriate bounds on these impls. This also prepares us for more complex transmutes such as "overwriting/tearing" transmutes, as we can require overwriting/tearing transmutability *only* for shrikning casts, but not for size-preserving casts. Makes progress on #2701, #1940, #1852 gherrit-pr-id: Gd9d1c0de851091ffe6161889d21ca2167845a591
28a38ee to
ad5d704
Compare
With this change, some
TryTransmuteFromPtrimpls become conditionallysound – specifically, they are sound for size-preserving casts, but not
for size-shrinking casts. In order to ensure they remain sound, we make
the cast a type parameter on
TryTransmuteFromPtr, which allows us toadd the appropriate bounds on these impls. This also prepares us for
more complex transmutes such as "overwriting/tearing" transmutes, as we
can require overwriting/tearing transmutability only for shrikning
casts, but not for size-preserving casts.
Makes progress on #2701, #1940, #1852
Latest Update: v33 — Compare vs v32
📚 Full Patch History
Links show the diff between the row version and the column version.