Repository navigation
Conversation
Generated service code shares a Rust module with the package's service traits and, in connectrpc-build output, its messages and enums, and each generated module has `use super::*;`. A proto item named after a prelude item, in the package or a parent package, therefore shadows it. The templates wrote `Result`, `Option`, `Box`, `Send`, `Sync`, `Clone` and `Into` without a path, so `message Result` (as in Arrow Flight) failed with E0107 on every client method. The templates now write a `::std::...` path for everything the stubs do not declare, `Some`, `None` and `Ok` included. A message, service or sub-package named `S` or `T`, the generic parameters of the generated `impl` blocks, is written `self::S`. `stubs_resolve_only_their_own_names` fails when a template names a type, trait or module that the stubs do not declare without a `::` root. Signed-off-by: Iain McGinniss <309153+iainmcgin@users.noreply.github.com>
iainmcgin
marked this pull request as ready for review
October 6, 2026 23:23
This branch has not been deployed
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 service code shares a Rust module with the package's service traits and, in
connectrpc-buildoutput, its messages and enums, and each generated module hasuse super::*;. A proto item named after a prelude item, in the package or a parent package, therefore shadows it. The templates wroteResult,Option,Box,Send,Sync,CloneandIntowithout a path, so Arrow Flight'smessage Resultfails on every client method:The templates now write a
::std::…path for everything the stubs do not declare,Some,NoneandOkincluded. Users with checked-in stubs regenerate: every*.__connect.rsfile changes in that form only, and the generated API stays the same.A message, service or sub-package named
SorTresolved to a generic parameter of the generatedimplblocks, and is now writtenself::S. The alternative is renaming the parameters to__Sand__T, which changes the rustdoc of every generated client and server.A glob import of such a package still shadows
Resultin the user's own module; the guide now says to import the module under an alias. The guide's rule for colliding service names said "differ only in case", whichXgetandXGetdisprove, and is reworded.Conflicts with #324 in one hunk of
codegen.rsand two test files. The second to merge regenerates the checked-in stubs.