Skip to content

Conversation

@joshlf
Copy link
Member

@joshlf joshlf commented Jan 23, 2026

This prepares us for a future change in which some impls will only be
sound for certain cast types. It also allows us to simplify some APIs
and implementations on Ptr.

Makes progress on #2701, #1940, #1852


Latest Update: v20 — Compare vs v19

📚 Full Patch History

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

Version v19 v18 v17 v16 v15 v14 v13 v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v20 v19 v18 v17 v16 v15 v14 v13 v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v19 v18 v17 v16 v15 v14 v13 v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v18 v17 v16 v15 v14 v13 v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v17 v16 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 introduces a significant refinement to the pointer transmutation traits by adding a CastExact type parameter. This parameter explicitly defines the casting mechanism used during transmutations, paving the way for future safety improvements where certain transmutations might only be valid with specific cast types. The changes involve updating trait definitions, method signatures, and their corresponding implementations to leverage this new type-level information, enhancing the precision and safety guarantees of pointer operations.

Highlights

  • Trait Parameterization: The TryTransmuteFromPtr and TransmuteFromPtr traits now include a new type parameter C, which specifies the exact casting mechanism (CastExact) to be used during pointer transmutations.
  • Enhanced Type Safety: This change allows for more granular control over the soundness of transmutations, enabling future implementations to enforce specific casting requirements.
  • Codebase Alignment: Various Ptr methods (transmute, recall_validity, try_into_valid) and TryTransmuteFromPtr implementations have been updated to incorporate and utilize this new C type parameter, ensuring consistency across the codebase.

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

@codecov-commenter
Copy link

codecov-commenter commented Jan 23, 2026

Codecov Report

❌ Patch coverage is 95.23810% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 91.31%. Comparing base (1a21b6d) to head (2bb0c47).

Files with missing lines Patch % Lines
src/lib.rs 75.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2921      +/-   ##
==========================================
- Coverage   91.33%   91.31%   -0.02%     
==========================================
  Files          20       20              
  Lines        5918     5897      -21     
==========================================
- Hits         5405     5385      -20     
+ Misses        513      512       -1     

☔ 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.

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 refactors the TransmuteFromPtr and TryTransmuteFromPtr traits to explicitly include the cast type as a generic parameter. This change enhances type safety and provides more granular control over pointer transmutations, which is crucial for future soundness checks. The documentation and associated unsafe impl blocks have been updated to reflect these changes. All modifications appear to be correct and align with the stated objective of preparing for future soundness-dependent cast types.

@joshlf joshlf force-pushed the G1cb98a9a25bc3bcf02d17e63b5389c2d66e9b4d8 branch 4 times, most recently from 43a76ea to c7676f9 Compare January 24, 2026 17:15
@joshlf joshlf changed the base branch from G0973aa3261bb811a53f7d99b8d38df5d6c328d52 to Gbef390739b3d30f77bab67b5336a922b7a8cfb48 January 24, 2026 17:15
@joshlf joshlf force-pushed the Gbef390739b3d30f77bab67b5336a922b7a8cfb48 branch from 874ac1a to 6e86abb Compare January 24, 2026 17:19
@joshlf joshlf force-pushed the G1cb98a9a25bc3bcf02d17e63b5389c2d66e9b4d8 branch 2 times, most recently from 5f0ebe0 to fc1ff83 Compare January 24, 2026 17:40
@joshlf joshlf force-pushed the Gbef390739b3d30f77bab67b5336a922b7a8cfb48 branch from 6e86abb to fde6f62 Compare January 24, 2026 17:40
@joshlf joshlf force-pushed the G1cb98a9a25bc3bcf02d17e63b5389c2d66e9b4d8 branch from fc1ff83 to 918103f Compare January 24, 2026 17:51
@joshlf joshlf changed the base branch from Gbef390739b3d30f77bab67b5336a922b7a8cfb48 to G76a957e3cecd7c790ce400ca40a320682ca9d9a9 January 24, 2026 17:51
@joshlf joshlf force-pushed the G1cb98a9a25bc3bcf02d17e63b5389c2d66e9b4d8 branch from 918103f to 565194b Compare January 26, 2026 04:18
@joshlf joshlf force-pushed the G76a957e3cecd7c790ce400ca40a320682ca9d9a9 branch from 9be40b4 to aec697e Compare January 26, 2026 04:18
@joshlf joshlf force-pushed the G1cb98a9a25bc3bcf02d17e63b5389c2d66e9b4d8 branch 2 times, most recently from fec3c4e to 0bba9e9 Compare January 26, 2026 04:35
@joshlf joshlf force-pushed the G76a957e3cecd7c790ce400ca40a320682ca9d9a9 branch from aec697e to d65cc63 Compare January 26, 2026 15:27
@joshlf joshlf force-pushed the G1cb98a9a25bc3bcf02d17e63b5389c2d66e9b4d8 branch 2 times, most recently from 3852df9 to b3dc714 Compare January 26, 2026 15:38
Base automatically changed from G76a957e3cecd7c790ce400ca40a320682ca9d9a9 to main January 26, 2026 16:21
@joshlf joshlf force-pushed the G1cb98a9a25bc3bcf02d17e63b5389c2d66e9b4d8 branch from b3dc714 to bdba77b Compare January 26, 2026 16:26
@joshlf joshlf added this pull request to the merge queue Jan 26, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to a conflict with the base branch Jan 26, 2026
This prepares us for a future change in which some impls will only be
sound for certain cast types. It also allows us to simplify some APIs
and implementations on `Ptr`.

Makes progress on #2701, #1940, #1852

gherrit-pr-id: G1cb98a9a25bc3bcf02d17e63b5389c2d66e9b4d8
@joshlf joshlf force-pushed the G1cb98a9a25bc3bcf02d17e63b5389c2d66e9b4d8 branch from bdba77b to 2bb0c47 Compare January 26, 2026 17:03
@joshlf joshlf enabled auto-merge January 26, 2026 17:04
@joshlf joshlf added this pull request to the merge queue Jan 26, 2026
Merged via the queue into main with commit 5fcf372 Jan 26, 2026
104 checks passed
@joshlf joshlf deleted the G1cb98a9a25bc3bcf02d17e63b5389c2d66e9b4d8 branch January 26, 2026 17:58
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