Skip to content

Conversation

@joshlf
Copy link
Member

@joshlf joshlf commented Jan 8, 2026

Makes progress on #5
Closes #1831
Closes #1832


Latest Update: v10 — Compare vs v9

📚 Full Patch History

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

Version v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v8 v7 v6 v5 v4 v3 v2 v1 Base
v7 v6 v5 v4 v3 v2 v1 Base
v6 v5 v4 v3 v2 v1 Base
v5 v4 v3 v2 v1 Base
v4 v3 v2 v1 Base
v3 v2 v1 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

❌ Patch coverage is 96.07843% with 2 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (G7691845b6b02e9f3d9578435d732bacfa6ca674f@6a4dcd8). Learn more about missing BASE report.

Files with missing lines Patch % Lines
src/util/macros.rs 0.00% 1 Missing ⚠️
src/wrappers.rs 66.66% 1 Missing ⚠️
Additional details and impacted files
@@                             Coverage Diff                              @@
##             G7691845b6b02e9f3d9578435d732bacfa6ca674f    #2876   +/-   ##
============================================================================
  Coverage                                             ?   91.50%           
============================================================================
  Files                                                ?       20           
  Lines                                                ?     5912           
  Branches                                             ?        0           
============================================================================
  Hits                                                 ?     5410           
  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
Makes progress on #5
Closes #1831
Closes #1832

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