Skip to content

docs: note that google::protobuf::Option shadows the prelude under a glob import - #426

Merged
iainmcgin merged 1 commit into
mainfrom
iain/wkt-option-glob-note
Sep 8, 2026
Merged

iainmcgin merged 1 commit into
mainfrom
iain/wkt-option-glob-note

Conversation

@iainmcgin

Copy link
Copy Markdown
Collaborator

type.proto (added to buffa-types in #394) defines message Option, so use buffa_types::google::protobuf::*; shadows the prelude Option and every Option<T> in that module fails with E0107. The crate rustdoc and the 0.9.2 changelog already say so; this adds the same note to the guide's well-known-types section, where someone choosing an import style will read it.

We looked at renaming, feature-gating, or moving the type for 0.10 and decided against all three: codegen always emits ::core::option::Option so generated code is immune, buffa-test already compiles user protos that declare message Option, no known consumer glob-imports the module, and prost-types, protobuf-go and upstream protobuf-rust all keep the name. A rename or submodule would break the proto-path-to-Rust-path mapping extern_path depends on; a feature gate would have to cover api/type/source_context together and needs per-file cfg support codegen does not have.

Doc-only; no changelog fragment.

…glob import

type.proto's Option message is kept under its proto name, as protoc,
prost-types and protobuf-go keep it; the guide now says to import WKTs
by name and what the error looks like if a module glob-imports the
package.
@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@iainmcgin
iainmcgin marked this pull request as ready for review September 6, 2026 17:22
@iainmcgin
iainmcgin added this pull request to the merge queue Sep 8, 2026
Merged via the queue into main with commit bfcb32b Sep 8, 2026
11 checks passed
@iainmcgin
iainmcgin deleted the iain/wkt-option-glob-note branch September 8, 2026 15:28
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 8, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants