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
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct M {
#[prost(message, optional, tag = "2")]
pub reply: ::core::option::Option<m::SubMessage>,
}
/// Nested message and enum types in `M`.
pub mod m {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SubMessage {
#[prost(message, repeated, tag = "1")]
pub item: ::prost::alloc::vec::Vec<sub_message::ItemEntry>,
}
}
the error:
error[E0433]: failed to resolve: use of undeclared crate or module `sub_message`
--> D:\code\sni_things\target\debug\build\sni_things-e5c2e47c00096f71\out/_.rs:13:44
|
13 | pub item: ::prost::alloc::vec::Vec<sub_message::ItemEntry>,
| ^^^^^^^^^^^ use of undeclared crate or module `sub_message`
This works if I change the map in the proto definition into a scalar, or if I move SubMessage out of M (so it's no longer nested). (of course in real life I don't control the protobuf file, so this solution doesn't work very well).
The text was updated successfully, but these errors were encountered:
When package name is empty, but type_path is filled, the fq_message_name should begin with a single dot.
Two duplicate implementations are moved to a separate function.
A test is added that creates a sub message without a package name. The code generator uses the message name to generate a rust module path, which is invalid.
fixes: tokio-rs#843
When package name is empty, but type_path is filled, the fq_message_name should begin with a single dot.
Two duplicate implementations are moved to a separate function.
A test is added that creates a sub message without a package name. The code generator uses the message name to generate a rust module path, which is invalid.
fixes: #843
Using a protobuf file with these contents:
I'm getting invalid code:
the error:
This works if I change the
map
in the proto definition into a scalar, or if I moveSubMessage
out ofM
(so it's no longer nested). (of course in real life I don't control the protobuf file, so this solution doesn't work very well).The text was updated successfully, but these errors were encountered: