Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to install reqwest #2246

Open
Altanis opened this issue Apr 13, 2024 · 3 comments
Open

Unable to install reqwest #2246

Altanis opened this issue Apr 13, 2024 · 3 comments

Comments

@Altanis
Copy link

Altanis commented Apr 13, 2024

When adding reqwest to my dependency list and building, I get this error (presumably from a subdependency of yours, as building works without reqwest in my dependency list):

error[E0195]: lifetime parameters or bounds on type `Target` do not match the trait declaration
  --> /Users/altanis/.cargo/registry/src/index.crates.io-6f17d22bba15001f/native-tls-0.2.11/src/imp/security_framework.rs:41:1
   |
41 | / lazy_static! {
42 | |     static ref TEMP_KEYCHAIN: Mutex<Option<(SecKeychain, TempDir)>> = Mutex::new(None);
43 | | }
   | |_^ lifetimes do not match type in trait
   |
   = note: this error originates in the macro `__lazy_static_internal` which comes from the expansion of the macro `lazy_static` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0599]: no method named `lock` found for struct `TEMP_KEYCHAIN` in the current scope
   --> /Users/altanis/.cargo/registry/src/index.crates.io-6f17d22bba15001f/native-tls-0.2.11/src/imp/security_framework.rs:162:45
    |
41  | / lazy_static! {
42  | |     static ref TEMP_KEYCHAIN: Mutex<Option<(SecKeychain, TempDir)>> = Mutex::new(None);
43  | | }
    | |_- method `lock` not found for this struct
...
162 |           let keychain = match *TEMP_KEYCHAIN.lock().unwrap() {
    |                                               ^^^^ method not found in `TEMP_KEYCHAIN`

error[E0282]: type annotations needed
   --> /Users/altanis/.cargo/registry/src/index.crates.io-6f17d22bba15001f/native-tls-0.2.11/src/imp/security_framework.rs:163:49
    |
163 |             Some((ref keychain, _)) => keychain.clone(),
    |                                                 ^^^^^ cannot infer type

error[E0599]: no method named `lock` found for struct `TEMP_KEYCHAIN` in the current scope
   --> /Users/altanis/.cargo/registry/src/index.crates.io-6f17d22bba15001f/native-tls-0.2.11/src/imp/security_framework.rs:155:32
    |
41  | / lazy_static! {
42  | |     static ref TEMP_KEYCHAIN: Mutex<Option<(SecKeychain, TempDir)>> = Mutex::new(None);
43  | | }
    | |_- method `lock` not found for this struct
...
155 |                   *TEMP_KEYCHAIN.lock().unwrap() = None;
    |                                  ^^^^ method not found in `TEMP_KEYCHAIN`

Some errors have detailed explanations: E0195, E0282, E0599.
For more information about an error, try `rustc --explain E0195`.
error: could not compile `native-tls` (lib) due to 4 previous errors
warning: build failed, waiting for other jobs to finish...
@seanmonstar
Copy link
Owner

Could it be your rustc compiler is too old?

@Altanis
Copy link
Author

Altanis commented Apr 13, 2024

I don't think so:

server git:(main) ✗ rustc --version
rustc 1.79.0-nightly (c9f8f3438 2024-03-27)

If it helps, I'm using MacOS Ventura 13.2.1 (on an M2 chip).

@seanmonstar
Copy link
Owner

Some other simple things to try is cargo clean, in case something messed up in the cache. And also cargo update, in case you're using an old version of the dependencies.

This repo is actively maintained, and CI also is passing, so it's likely a difference in your environment that I can't easily predict.

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

No branches or pull requests

2 participants