Repository navigation
cleanup(internal/sidekick/rust): qualify FromProto calls - #7909
Merged
Merged
Conversation
Generated FromProto impls, and the LRO Any conversion in the gRPC transport, passed v.cnv() to functions generic over Into<FieldType>, so the target type was only inferred when the prost type had exactly one FromProto impl. Adding a second impl for a shared prost type, such as prost_types::Timestamp, in gax-internal broke generated gRPC crates with E0283 (67 sites in google-cloud-storage alone). Call gaxi::prost::FromProto::<FieldType>::cnv explicitly. Boxed recursive fields now dereference the box first, and enum fields (i32 in prost) convert with the enum's From<i32> impl, matching the existing repeated enum branch. For googleapis/google-cloud-rust#7284
Contributor
There was a problem hiding this comment.
Code Review
This pull request updates the Rust code generation templates and tests to use explicit type-qualified FromProto trait method calls (e.g., FromProto::<T>::cnv) instead of calling the .cnv() method directly. This change affects messages, maps, oneofs, and LRO conversions, ensuring more robust type resolution during compilation. Additionally, new test cases are added to verify the conversion of messages with optional enums and enum-valued maps. There are no review comments to address, and I have no further feedback to provide.
Contributor
Author
|
Changes with regeneration: googleapis/google-cloud-rust@2dcced8...413da7a |
dbolduc
approved these changes
Nov 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Generated FromProto impls, and the LRO Any conversion in the gRPC transport, passed v.cnv() to functions generic over Into, so the target type was only inferred when the prost type had exactly one FromProto impl. Adding a second impl for a shared prost type, such as prost_types::Timestamp, in gax-internal can brake generated gRPC crates.
Call gaxi::prost::FromProto::::cnv explicitly. Boxed recursive fields now dereference the box first, and enum fields (i32 in prost) convert with the enum's From impl, matching the existing repeated enum branch.
For googleapis/google-cloud-rust#7284