You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since Rust doesn't have scoped enums (and won't until after 1.0), a workaround for this might be to place protobuf messages into their own Rust modules. protoc enforces that enum values must be unique within messages, e.g. this:
foo.proto:3:18: "FOO" is already defined in "MessageA".
foo.proto:3:18: Note that enum values use C++ scoping rules, meaning that enum values are siblings of their type, not children of it. Therefore, "FOO" must be unique within "MessageA", not just within "EnumB".
The text was updated successfully, but these errors were encountered:
This version will not produce correct Rust with rust-protobuf (see
stepancheg/rust-protobuf#21). Could be a good idea instead to write an
awk script or something to munge constants from the .proto into a Rust
source file, since we won't actually be using protobufs over the wire.
A protobuf file like this:
generates Rust like:
Since Rust doesn't have scoped enums (and won't until after 1.0), a workaround for this might be to place protobuf messages into their own Rust modules. protoc enforces that enum values must be unique within messages, e.g. this:
fails to compile with:
The text was updated successfully, but these errors were encountered: