Closed shizzard closed 2 months ago
So because you generate an enum B and there is a generic type B, there is a conflict.
The simplest solution seems to change the generated function signature to: fn encode_raw(&self, buf: &mut impl ::prost::bytes::BufMut)
. That way there is no generic parameter B
. Are you willing to create a PR that changes all <B>
+ where B
to a impl Type
?
Yes, the solution makes sense, I'll make a PR with these changes.
@caspermeijn note, I also changed the generated functions for enums (Enumeration
derive), to make everything consistent and to avoid similar issues with enums.
Minimal protobuf file to reproduce:
Problem is that generated
impl ::prost::Message for A
contains a generic type parameter for a number of functions, that shadows theB
enum:The error message from the compiler, that is not clear:
There are at least two possible solutions:
<ImplProstBytesBufMut>
instead of<B>
);Probably, there are some other similar issues that are not noticed yet.