Repository navigation
cleanup(internal/sidekick/rust): qualify ToProto calls - #7897
Merged
Merged
Conversation
Generated ToProto implementations and gRPC transport callers previously invoked .to_proto() without qualifying the target prost type. When multiple crates in a dependency graph implement gaxi::prost::ToProto<LocalProstT> for the same shared model type (such as google_cloud_rpc::model::Status or google_cloud_type::model::Expr), unqualified .to_proto() calls fail with E0284 type inference ambiguity. Annotate fields and external nested types with their target prost types and emit fully qualified gaxi::prost::ToProto::<ProstT>::to_proto calls across convert-prost and transport templates. For googleapis/google-cloud-rust#7284
Contributor
Author
|
Regenerated: googleapis/google-cloud-rust#7374 |
Contributor
There was a problem hiding this comment.
Code Review
This pull request refactors the Rust code generator to qualify ToProto calls with explicit types (e.g., gaxi::prost::ToProto::::to_proto) rather than calling .to_proto() directly. To support this, a new ProstType field is added to field annotations, and helper functions are introduced in a new prost.go file to map well-known types and resolve paths for prost-generated types. Templates and tests are updated accordingly. I have no feedback to provide as there are no review comments.
suzmue
marked this pull request as ready for review
November 9, 2026 16:20
coryan
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 ToProto implementations and gRPC transport callers previously invoked .to_proto() without qualifying the target prost type. When multiple crates in a dependency graph implement gaxi::prost::ToProto for the same shared model type (such as google_cloud_rpc::model::Status or google_cloud_type::model::Expr), unqualified .to_proto() calls fail with E0284 type inference ambiguity.
Annotate fields and external nested types with their target prost types and emit fully qualified gaxi::prost::ToProto::::to_proto calls across convert-prost and transport templates.
For googleapis/google-cloud-rust#7284