docs: note that google::protobuf::Option shadows the prelude under a glob import - #426
Merged
Merged
Conversation
…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.
|
All contributors have signed the CLA ✍️ ✅ |
iainmcgin
marked this pull request as ready for review
September 6, 2026 17:22
azdagron
approved these changes
Sep 8, 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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
type.proto(added tobuffa-typesin #394) definesmessage Option, souse buffa_types::google::protobuf::*;shadows the preludeOptionand everyOption<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::Optionso generated code is immune,buffa-testalready compiles user protos that declaremessage 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 mappingextern_pathdepends on; a feature gate would have to coverapi/type/source_contexttogether and needs per-filecfgsupport codegen does not have.Doc-only; no changelog fragment.