Skip to content
This repository has been archived by the owner on Apr 8, 2024. It is now read-only.

Build fails on Rust 1.36.0 #171

Open
amrx101 opened this issue Jan 27, 2020 · 2 comments
Open

Build fails on Rust 1.36.0 #171

amrx101 opened this issue Jan 27, 2020 · 2 comments

Comments

@amrx101
Copy link

amrx101 commented Jan 27, 2020

--> /home/amit/.cargo/registry/src/github.com-1ecc6299db9ec823/bytes-0.5.4/src/bytes.rs:911:1
|
911 | const _: [(); 0 - mem::align_of::<Shared>() % 2] = []; // Assert that the alignment of `Shared` is        divisible by 2.
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: for more information, see https://github.com/rust-lang/rust/issues/54912

Build fails on Rust 1.36.0

@glyn
Copy link

glyn commented Jan 29, 2020

Hmmm. ./build-all.sh produces different errors with Rust 1.40.0:

   Compiling grpc v0.7.0 (path to grpc-rust/grpc)
error[E0277]: the trait bound `httpbis::HeaderValue: std::convert::AsRef<[u8]>` is not satisfied
  --> grpc/src/proto/metadata.rs:78:48
   |
78 |             true => Bytes::from(base64::decode(&header.value)?),
   |                                                ^^^^^^^^^^^^^ the trait `std::convert::AsRef<[u8]>` is not implemented for `httpbis::HeaderValue`
   |
  ::: /Users/gnormington/.cargo/registry/src/github.com-1ecc6299db9ec823/base64-0.9.3/src/decode.rs:68:27
   |
68 | pub fn decode<T: ?Sized + AsRef<[u8]>>(input: &T) -> Result<Vec<u8>, DecodeError> {
   |                           ----------- required by this bound in `base64::decode`

error[E0308]: match arms have incompatible types
  --> grpc/src/proto/metadata.rs:79:22
   |
77 |           let value = match key.is_bin() {
   |  _____________________-
78 | |             true => Bytes::from(base64::decode(&header.value)?),
   | |                     ------------------------------------------- this is found to be of type `bytes::Bytes`
79 | |             false => header.value,
   | |                      ^^^^^^^^^^^^ expected struct `bytes::Bytes`, found struct `httpbis::HeaderValue`
80 | |         };
   | |_________- `match` arms have incompatible types
   |
   = note: expected type `bytes::Bytes`
              found type `httpbis::HeaderValue`

error: aborting due to 2 previous errors

Some errors have detailed explanations: E0277, E0308.
For more information about an error, try `rustc --explain E0277`.
error: could not compile `grpc`.

@BStenfors
Copy link

BStenfors commented Feb 4, 2020

I am getting the same error(s) on 1.40.0 as well.

I was on 1.39.0 but upgraded as suggested to avoid an error from an unstable version of mem::take.

Have you had any luck resolving the issue?

Just updated rust to stable 1.41.0 and still getting the same error.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants