Skip to content

Conversation

@joshlf
Copy link
Member

@joshlf joshlf commented Jan 27, 2026


Latest Update: v16 — Compare vs v15

📚 Full Patch History

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

Version v15 v14 v13 v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v16 v15 v14 v13 v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v15 v14 v13 v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v14 v13 v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v13 v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v11 v10 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 zerocopy library by integrating robust support for projecting enum tags. This foundational change allows the library to understand and work with the discriminant of enums, which is crucial for safely and correctly accessing enum variants in a zero-copy manner. This enables more advanced and type-safe operations on data structures that include enums, improving the overall utility and correctness of the library for complex data layouts.

Highlights

  • Enum Tag Projection Support: Introduced new associated types (Tag, ProjectToTag) and a method (project_tag) to the HasField and ProjectField traits, enabling the projection of an enum's discriminant (tag) for safe variant access.
  • Default Tag Implementation: Provided a default Tag = () and ProjectToTag = CastToUnit for non-enum types, ensuring backward compatibility and a consistent interface across all types.
  • CastToUnit Utility: Added a new CastToUnit type and its implementations to facilitate casting any type to (), which is used for the default tag projection for non-enum types.
  • Derive Macro Updates: Modified the zerocopy-derive macros to automatically implement the new Tag and ProjectToTag associated types for both enums (using a generated ___ZerocopyTag) and other types, streamlining integration.
  • Refined Projectability Checks: Updated the core project method to leverage the new project_tag for more accurate and type-safe checks of field projectability, especially for enum variants.

🧠 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 introduces support for projecting enum tags, which is a significant new feature. It involves extending the HasField and ProjectField traits with Tag and ProjectToTag associated types, and modifying the Ptr::project logic to leverage these new types. New utility types like CastToUnit and internal ___ZerocopyTag enums are also introduced to facilitate this. While the core logic seems aligned with the feature's goal, there are some critical issues related to safety justifications and a potential breaking change in tuple support, as well as a medium-severity issue regarding the visibility of an internal enum.

@joshlf joshlf force-pushed the G06bb22c59364654d5c0b44cdcb9b70ad58fe8092 branch from e116c4c to 802915a Compare January 27, 2026 18:02
@codecov-commenter
Copy link

codecov-commenter commented Jan 27, 2026

Codecov Report

❌ Patch coverage is 66.66667% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 92.33%. Comparing base (1876c9d) to head (a98e1d0).

Files with missing lines Patch % Lines
src/impls.rs 0.00% 8 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2940      +/-   ##
==========================================
- Coverage   92.44%   92.33%   -0.12%     
==========================================
  Files          19       19              
  Lines        5825     5843      +18     
==========================================
+ Hits         5385     5395      +10     
- Misses        440      448       +8     

☔ 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 G06bb22c59364654d5c0b44cdcb9b70ad58fe8092 branch 5 times, most recently from 55cbce3 to b0b3dd7 Compare January 27, 2026 18:55
@joshlf joshlf enabled auto-merge January 27, 2026 18:55
@joshlf
Copy link
Member Author

joshlf commented Jan 27, 2026

/gemini review

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 introduces support for projecting enum tags, which is a significant and well-implemented feature. The changes consistently update the HasField trait with Tag and ProjectToTag associated types, and provide appropriate implementations across the codebase, including for tuples and generated enum variants. The new CastToUnit type simplifies handling non-enum types. The safety comments are thorough and reference relevant Rust documentation, which is excellent for maintaining soundness. The modifications to is_projectable and related logic correctly integrate the new tag projection mechanism.

gherrit-pr-id: G06bb22c59364654d5c0b44cdcb9b70ad58fe8092
@joshlf joshlf force-pushed the G06bb22c59364654d5c0b44cdcb9b70ad58fe8092 branch from a4d2ae8 to a98e1d0 Compare January 27, 2026 19:46
@joshlf joshlf added this pull request to the merge queue Jan 27, 2026
Merged via the queue into main with commit b66e6cf Jan 27, 2026
106 checks passed
@joshlf joshlf deleted the G06bb22c59364654d5c0b44cdcb9b70ad58fe8092 branch January 27, 2026 20:21
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