Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .changes/unreleased/Fixed-20261004-215800.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
kind: Fixed
body: |-
**Proto types and services named after Rust prelude items compile.**
Generated service code wrote `Result`, `Option`, `Box`, `Send`, `Sync`,
`Clone` and `Into` without a path. A message, enum or service with one of
those names in the same package or a parent package (`message Result`, as
in Arrow Flight) took its place, and the build failed inside
`*.__connect.rs` with errors such as E0107 (`struct takes 0 generic
arguments`) or E0404 (`expected trait, found struct`). Generated code now
writes the full path, such as `::std::result::Result`. It reaches a message
or service named `S` or `T`, the generic parameters of the generated `impl`
blocks, as `self::S`. Regenerate checked-in code to pick this up: every
`*.__connect.rs` file changes, and the generated API stays the same.
time: 2026-10-04T21:58:00.000000000+00:00
13 changes: 13 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,19 @@ Key rules:
(`::connectrpc::...`, `::buffa::...`) — no `use` statements at module
scope. This lets multiple generated files be `include!`d into the same
Rust module without E0252 collisions.
- Fully-qualified paths include **the prelude**: write
`::std::result::Result`, `::std::marker::Send`,
`::std::option::Option::Some`. In `connectrpc-build` output the stubs
share a module with the package's messages and enums, and in every layout
each `pub mod` has `use super::*;`. So `message Result` or `service Send`,
in the package or a parent package, shadows the prelude there. The
`stubs_resolve_only_their_own_names` test fails when a template writes a
type, trait or module that the stubs do not declare without a `::` root.
It skips attributes (`#[derive(Clone)]`) and primitives (`str`).
- Every **generic type parameter** that a template declares goes in
`GENERIC_PARAMS`, so that a message, service or sub-package of the same
name is reached through `self::` (`message T` is written `self::T`). The
same test fails on a parameter that is not listed.

## Conformance Tests

Expand Down
178 changes: 98 additions & 80 deletions benches/rpc/src/generated/connect/bench.__connect.rs

Large diffs are not rendered by default.

38 changes: 22 additions & 16 deletions benches/rpc/src/generated/connect/bench_noutf8.__connect.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 22 additions & 16 deletions benches/rpc/src/generated/connect/echo_bloat.__connect.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading