stepancheg / grpc-rust

Rust implementation of gRPC
MIT License
1.38k stars 125 forks source link

error[E0308] when compiling latest version #168

Closed scuzie closed 4 years ago

scuzie commented 4 years ago

As the title says, when compiling the latest version of grpc (v0.6.1) an error occurs.

Compiling grpc v0.6.1
error[E0308]: mismatched types
  --> /home/d33vil/.cargo/registry/src/github.com-1ecc6299db9ec823/grpc-0.6.1/src/protobuf.rs:21:62
   |
21 |         let mut is = CodedInputStream::from_carllerche_bytes(&buf);
   |                                                              ^^^^ expected struct `bytes::bytes::Bytes`, found struct `bytes::Bytes`
   |
   = note: expected type `&bytes::bytes::Bytes`
              found type `&bytes::Bytes`
note: Perhaps two different versions of crate `bytes` are being used?
  --> /home/d33vil/.cargo/registry/src/github.com-1ecc6299db9ec823/grpc-0.6.1/src/protobuf.rs:21:62
   |
21 |         let mut is = CodedInputStream::from_carllerche_bytes(&buf);
   |                                                              ^^^^

error: aborting due to previous error

For more information about this error, try `rustc --explain E0308`.
error: could not compile `grpc`.
stepancheg commented 4 years ago

I guess you can force bytes create version 0.4. Grpc-rust need to be fixed nevertheless.

scuzie commented 4 years ago

Forcing the bytes crate version doesn't make a difference

przygienda commented 4 years ago

you have to specify protobuf="~2.8" now to make it work.

stepancheg commented 4 years ago

Published version 0.6.2 where versions are properly pinned (to rust-protobuf 2.8 and bytes 0.4).

Now working on upgrade to tokio 0.3 (rust-http2 crate source is migrated, now working on grpc-rust).