Skip to content

Conversation

@joshlf
Copy link
Member

@joshlf joshlf commented Jan 8, 2026

Makes progress on #5
Closes #1831
Closes #1832


Latest Update: v44 — Compare vs v43

📚 Full Patch History

Links show the diff between the row version and the column version.

Version v43 v42 v41 v40 v39 v38 v37 v36 v35 v34 v33 v32 v31 v30 v29 v28 v27 v26 v25 v24 v23 v22 v21 v20 v19 v18 v17 v16 v15 v14 v13 v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v44 v43 v42 v41 v40 v39 v38 v37 v36 v35 v34 v33 v32 v31 v30 v29 v28 v27 v26 v25 v24 v23 v22 v21 v20 v19 v18 v17 v16 v15 v14 v13 v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v43 v42 Base
v42 v41 Base
v41 v40 Base
v40 v39 Base
v39 v38 Base
v38 v37 Base
v37 v36 Base
v36 v35 Base
v35 v34 Base
v34 v33 Base
v33 v32 Base
v32 v31 Base
v31 v30 Base
v30 v29 Base
v29 v28 Base
v28 v27 Base
v27 v26 Base
v26 v25 Base
v25 v24 Base
v24 v23 Base
v23 v22 Base
v22 v21 Base
v21 v20 Base
v20 v19 Base
v19 v18 Base
v18 v17 Base
v17 v16 Base
v16 v15 Base
v15 v14 Base
v14 v13 Base
v13 v12 Base
v12 v11 Base
v11 v10 Base
v10 v9 Base
v9 v8 Base
v8 v7 Base
v7 v6 Base
v6 v5 Base
v5 v4 Base
v4 v3 Base
v3 v2 Base
v2 v1 Base
v1 Base

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @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 significantly enhances the flexibility of the zerocopy crate by removing the Immutable trait requirement for deriving TryFromBytes, FromZeros, and FromBytes for unions. This change allows unions containing types like UnsafeCell, which are not inherently Immutable, to correctly implement these traits, broadening the utility of the derive macros without compromising memory safety.

Highlights

  • Removed Immutable Trait Bound for Unions: The Immutable trait bound has been removed for TryFromBytes, FromZeros, and FromBytes derives on unions, allowing these derives to be used with unions containing non-Immutable types.
  • Updated Safety Justification: The safety comment for TryFromBytes on unions has been updated to clarify that safety is ensured by ReadOnly<Self>: Immutable, which holds unconditionally, rather than Self: Immutable.
  • New Test Cases for UnsafeCell Unions: New test cases have been added for unions containing UnsafeCell to validate the updated derive behavior for FromBytes, FromZeros, and TryFromBytes.

🧠 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 Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a 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 correctly removes the Immutable bound requirement for fields of unions when deriving TryFromBytes, FromZeros, and FromBytes. This is a significant improvement that allows unions containing types with interior mutability (like UnsafeCell) to use these derives. The implementation ensures safety by using a ReadOnly wrapper during validity checks, and the corresponding safety comments are updated accordingly. The change is supported by new tests that verify the new functionality. The implementation is sound and the code quality is high.

@joshlf joshlf force-pushed the G0d92654de6e9a8c16ac830e35adf298a1b486df4 branch from 21a1122 to b220dc0 Compare January 8, 2026 19:34
@joshlf joshlf force-pushed the G27dd847426e3572e87b20bd64642c9fcb0e51ec8 branch from 2563db5 to 933a997 Compare January 8, 2026 19:34
@joshlf joshlf force-pushed the G0d92654de6e9a8c16ac830e35adf298a1b486df4 branch from b220dc0 to e7e1674 Compare January 8, 2026 19:40
@joshlf joshlf force-pushed the G27dd847426e3572e87b20bd64642c9fcb0e51ec8 branch 2 times, most recently from b886722 to fe1e718 Compare January 8, 2026 19:50
@joshlf joshlf force-pushed the G0d92654de6e9a8c16ac830e35adf298a1b486df4 branch from e7e1674 to 6321cc7 Compare January 8, 2026 19:50
@codecov-commenter
Copy link

codecov-commenter commented Jan 8, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (G7691845b6b02e9f3d9578435d732bacfa6ca674f@532249e). Learn more about missing BASE report.

Additional details and impacted files
@@                             Coverage Diff                              @@
##             G7691845b6b02e9f3d9578435d732bacfa6ca674f    #2876   +/-   ##
============================================================================
  Coverage                                             ?   91.51%           
============================================================================
  Files                                                ?       20           
  Lines                                                ?     5916           
  Branches                                             ?        0           
============================================================================
  Hits                                                 ?     5414           
  Misses                                               ?      502           
  Partials                                             ?        0           

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@joshlf joshlf force-pushed the G0d92654de6e9a8c16ac830e35adf298a1b486df4 branch from 6321cc7 to dd15299 Compare January 9, 2026 00:00
@joshlf joshlf force-pushed the G27dd847426e3572e87b20bd64642c9fcb0e51ec8 branch from fe1e718 to 050ea06 Compare January 9, 2026 00:00
@joshlf joshlf force-pushed the G27dd847426e3572e87b20bd64642c9fcb0e51ec8 branch from 050ea06 to 2972d07 Compare January 9, 2026 16:57
@joshlf joshlf changed the base branch from G0d92654de6e9a8c16ac830e35adf298a1b486df4 to G7691845b6b02e9f3d9578435d732bacfa6ca674f January 9, 2026 16:57
@joshlf joshlf force-pushed the G7691845b6b02e9f3d9578435d732bacfa6ca674f branch from 5cf70a2 to e6fab2d Compare January 9, 2026 17:04
@joshlf joshlf force-pushed the G27dd847426e3572e87b20bd64642c9fcb0e51ec8 branch from 2972d07 to f5919bc Compare January 9, 2026 17:04
@joshlf joshlf force-pushed the G7691845b6b02e9f3d9578435d732bacfa6ca674f branch from e6fab2d to 6a4dcd8 Compare January 9, 2026 17:22
@joshlf joshlf force-pushed the G27dd847426e3572e87b20bd64642c9fcb0e51ec8 branch from f5919bc to 9562030 Compare January 9, 2026 17:22
@joshlf joshlf force-pushed the G7691845b6b02e9f3d9578435d732bacfa6ca674f branch from 6a4dcd8 to 3a76740 Compare January 15, 2026 23:32
@joshlf joshlf force-pushed the G27dd847426e3572e87b20bd64642c9fcb0e51ec8 branch from 9562030 to 625fa9b Compare January 15, 2026 23:32
@joshlf joshlf force-pushed the G7691845b6b02e9f3d9578435d732bacfa6ca674f branch from 3a76740 to 0873766 Compare January 16, 2026 00:02
@joshlf joshlf force-pushed the G27dd847426e3572e87b20bd64642c9fcb0e51ec8 branch from 625fa9b to 74741ec Compare January 16, 2026 00:02
@joshlf joshlf force-pushed the G7691845b6b02e9f3d9578435d732bacfa6ca674f branch from 0873766 to 4119ee4 Compare January 16, 2026 00:29
@joshlf joshlf force-pushed the G7691845b6b02e9f3d9578435d732bacfa6ca674f branch from 91e2600 to 054d5d4 Compare January 16, 2026 22:33
@joshlf joshlf force-pushed the G27dd847426e3572e87b20bd64642c9fcb0e51ec8 branch 2 times, most recently from 49a7d8d to d10a69f Compare January 16, 2026 22:49
@joshlf joshlf force-pushed the G7691845b6b02e9f3d9578435d732bacfa6ca674f branch 2 times, most recently from af9e006 to c511655 Compare January 16, 2026 22:54
@joshlf joshlf force-pushed the G27dd847426e3572e87b20bd64642c9fcb0e51ec8 branch from d10a69f to a6a8b11 Compare January 16, 2026 22:54
@joshlf joshlf force-pushed the G7691845b6b02e9f3d9578435d732bacfa6ca674f branch from c511655 to ecb8b50 Compare January 16, 2026 23:57
@joshlf joshlf force-pushed the G27dd847426e3572e87b20bd64642c9fcb0e51ec8 branch 2 times, most recently from a790906 to bdf5103 Compare January 17, 2026 00:48
@joshlf joshlf force-pushed the G7691845b6b02e9f3d9578435d732bacfa6ca674f branch 2 times, most recently from 0c1b442 to f02e8df Compare January 21, 2026 22:51
@joshlf joshlf force-pushed the G27dd847426e3572e87b20bd64642c9fcb0e51ec8 branch from bdf5103 to 2051536 Compare January 21, 2026 22:51
@joshlf joshlf force-pushed the G7691845b6b02e9f3d9578435d732bacfa6ca674f branch from f02e8df to 187a61f Compare January 22, 2026 22:33
@joshlf joshlf force-pushed the G27dd847426e3572e87b20bd64642c9fcb0e51ec8 branch 2 times, most recently from d27a763 to ff40095 Compare January 22, 2026 22:47
@joshlf joshlf force-pushed the G7691845b6b02e9f3d9578435d732bacfa6ca674f branch 2 times, most recently from de2e502 to 9f2289d Compare January 22, 2026 22:54
@joshlf joshlf force-pushed the G27dd847426e3572e87b20bd64642c9fcb0e51ec8 branch from ff40095 to 3baa590 Compare January 22, 2026 22:54
@joshlf joshlf changed the title [derive] Allow TryFromBytes on non-Immutable unions [derive] Allow TryFromBytes on non-Immutable unions Jan 22, 2026
@joshlf joshlf force-pushed the G7691845b6b02e9f3d9578435d732bacfa6ca674f branch from 9f2289d to 129800e Compare January 23, 2026 18:57
@joshlf joshlf force-pushed the G27dd847426e3572e87b20bd64642c9fcb0e51ec8 branch from 3baa590 to 492e1fb Compare January 23, 2026 18:57
@joshlf joshlf force-pushed the G7691845b6b02e9f3d9578435d732bacfa6ca674f branch from 129800e to 6c1c181 Compare January 23, 2026 19:03
@joshlf joshlf force-pushed the G27dd847426e3572e87b20bd64642c9fcb0e51ec8 branch 2 times, most recently from 3a2be8c to a175c9e Compare January 23, 2026 19:21
@joshlf joshlf force-pushed the G7691845b6b02e9f3d9578435d732bacfa6ca674f branch from 6c1c181 to 878bd6b Compare January 23, 2026 19:21
Makes progress on #5
Closes #1831
Closes #1832

gherrit-pr-id: G27dd847426e3572e87b20bd64642c9fcb0e51ec8
@joshlf joshlf force-pushed the G27dd847426e3572e87b20bd64642c9fcb0e51ec8 branch from a175c9e to 58035cf Compare January 23, 2026 19:30
@joshlf joshlf force-pushed the G7691845b6b02e9f3d9578435d732bacfa6ca674f branch from 878bd6b to 532249e Compare January 23, 2026 19:30
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.

2 participants