grpc-rust
grpc-rust copied to clipboard
Build fails on Latest Commit
error[E0053]: method
read
has an incompatible type for trait --> grpc-protobuf/src/lib.rs:25:5 | 25 | fn read(&self, buf: Bytes) -> grpc::Result<M> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected structbytes::bytes::Bytes
, found structbytes::Bytes
| = note: expected fn pointerfn(&MarshallerProtobuf, bytes::bytes::Bytes) -> std::result::Result<_, _>
found fn pointerfn(&MarshallerProtobuf, bytes::Bytes) -> std::result::Result<_, _>
= note: perhaps two different versions of cratebytes
are being used?
rustc 1.49.0 (e1884a8e3 2020-12-29) commit e8a9b95d834fdcfd811e440dd3fbd0b9a7f71630
I was able to get past this by forcing protobuf
and protoc-rust
to version 2.17.0 in my Cargo.toml. The problem is that later versions of these crates upgrade the version of bytes
above 0.5 while grpc-rust still uses bytes v0.5.
thanks
Met the same issue:
error[E0308]: mismatched types
--> C:\Users\Winterreise\scoop\persist\rustup\.cargo\registry\src\github.com-1ecc6299db9ec823\grpc-protobuf-0.8.2\src\lib.rs:27:62
|
27 | let mut is = CodedInputStream::from_carllerche_bytes(&buf);
| ^^^^ expected struct `bytes::bytes::Bytes`, found struct `bytes::Bytes`
|
= note: expected reference `&bytes::bytes::Bytes`
found reference `&bytes::Bytes`
= note: perhaps two different versions of crate `bytes` are being used?
error: aborting due to previous error
For more information about this error, try `rustc --explain E0308`.
error: could not compile `grpc-protobuf`
protobuf = "2.14.0"
protoc-rust = "2.14.0"
cargo update -p protobuf --precise 2.14.0