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

use of unstable library feature 'mem_take' #170

Open
BStenfors opened this issue Jan 24, 2020 · 2 comments
Open

use of unstable library feature 'mem_take' #170

BStenfors opened this issue Jan 24, 2020 · 2 comments

Comments

@BStenfors
Copy link

Not sure if I am doing something wrong as I am still very new developer in rust but I keep getting the following error when cargo tries to build rust-http2:

use of unstable library feature 'mem_take'

Here is my current Cargo.toml:

[dependencies]
diesel = { version = "1.4.0", features = ["mysql"] }
dotenv = "0.10"
env_logger = "0.6.1"

actix = "0.8.1"
actix-web = "1.0.0-rc"

serde = "1.0.90"
serde_json = "1.0.39"
serde_derive = "1.0.90"
json = "*"

reqwest = "0.9.15"

base64 = "0.10.1"
url = "1.7.2"
rand = "0.6.5"
oauth2 = "1.3.0"

protobuf = "2.8.1"

grpc = { git = "https://github.com/stepancheg/grpc-rust" }
grpc-protobuf = { git = "https://github.com/stepancheg/grpc-rust" }

tls-api = "0.2.0"
tls-api-native-tls = "0.2.0"

futures = "0.1.26"
futures-cpupool = "0.1.8"

[build-dependencies]
protoc-rust-grpc = { git = "https://github.com/stepancheg/grpc-rust" }

Any ideas or suggestions would much appreciated!!

Cheers

@clonejo
Copy link

clonejo commented Jan 25, 2020

std::mem::take() is only stable since Rust 1.40.0, so you might just
have to get the currently newest stable Rust version.

https://doc.rust-lang.org/std/mem/fn.take.html

@BStenfors
Copy link
Author

BStenfors commented Jan 31, 2020

Awesome! Thanks for the tip. That resolved the mem::take() issue.

Now I am getting these 2 errors:

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

error[E0277]: the trait bound httpbis::HeaderValue: std::convert::AsRef<[u8]>is not satisfied --> /Users/bstenfors/.cargo/git/checkouts/grpc-rust-c0d13ba76cd4c520/2e41339/grpc/src/proto/metadata.rs:78:48 | 78 | true => Bytes::from(base64::decode(&header.value)?), | ^^^^^^^^^^^^^ the traitstd::convert::AsRef<[u8]>is not implemented forhttpbis::HeaderValue| ::: /Users/bstenfors/.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 inbase64::decode`

error[E0308]: match arms have incompatible types
--> /Users/bstenfors/.cargo/git/checkouts/grpc-rust-c0d13ba76cd4c520/2e41339/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

`

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

2 participants