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

Failed to build because of incompatible type #18350

Closed
zonyitoo opened this issue Oct 26, 2014 · 2 comments · Fixed by #18356
Closed

Failed to build because of incompatible type #18350

zonyitoo opened this issue Oct 26, 2014 · 2 comments · Fixed by #18356

Comments

@zonyitoo
Copy link

I just upgraded my rustc to rustc 0.13.0-nightly (f168c12c5 2014-10-25 20:57:10 +0000). But when I tried to rebuild my project, it failed with the following errors:

/Users/zonyitoo/Projects/shadowsocks-rust/src/crypto/cipher.rs:179:11: 179:17 error: cannot infer an appropriate lifetime due to conflicting requirements
/Users/zonyitoo/Projects/shadowsocks-rust/src/crypto/cipher.rs:179     match method {
                                                                             ^~~~~~
/Users/zonyitoo/Projects/shadowsocks-rust/src/crypto/cipher.rs:178:69: 246:2 note: first, the lifetime cannot outlive the anonymous lifetime #1 defined on the block at 178:68...
/Users/zonyitoo/Projects/shadowsocks-rust/src/crypto/cipher.rs:178 pub fn with_name(method: &str, key: &[u8]) -> Option<CipherVariant> {
/Users/zonyitoo/Projects/shadowsocks-rust/src/crypto/cipher.rs:179     match method {
/Users/zonyitoo/Projects/shadowsocks-rust/src/crypto/cipher.rs:180         #[cfg(feature="cipher-aes-cfb")]
/Users/zonyitoo/Projects/shadowsocks-rust/src/crypto/cipher.rs:181         CIPHER_AES_128_CFB => Some(OpenSSLCrypto(openssl::OpenSSLCipher::new(CipherTypeAes128Cfb, key))),
/Users/zonyitoo/Projects/shadowsocks-rust/src/crypto/cipher.rs:182         #[cfg(feature="cipher-aes-cfb")]
/Users/zonyitoo/Projects/shadowsocks-rust/src/crypto/cipher.rs:183         CIPHER_AES_128_CFB_1 => Some(OpenSSLCrypto(openssl::OpenSSLCipher::new(CipherTypeAes128Cfb1, key))),
                                                                   ...
/Users/zonyitoo/Projects/shadowsocks-rust/src/crypto/cipher.rs:179:11: 179:17 note: ...so that types are compatible (expected `&str`, found `&str`)
/Users/zonyitoo/Projects/shadowsocks-rust/src/crypto/cipher.rs:179     match method {
                                                                             ^~~~~~
note: but, the lifetime must be valid for the static lifetime...
/Users/zonyitoo/Projects/shadowsocks-rust/src/crypto/cipher.rs:238:9: 238:23 note: ...so that types are compatible (expected `&str`, found `&'static str`)
/Users/zonyitoo/Projects/shadowsocks-rust/src/crypto/cipher.rs:238         CIPHER_RC2_CFB => Some(OpenSSLCrypto(openssl::OpenSSLCipher::new(CipherTypeRc2Cfb, key))),
                                                                           ^~~~~~~~~~~~~~
error: aborting due to previous error

CIPHER_AES_128_CFB, CIPHER_AES_128_CFB_1, etc... are constants of type &'static str.

What does the error mean? I am confused.

@zonyitoo
Copy link
Author

Thanks @jakub- . It seems that the bug is fixed, please merge it to upstream asap. :)

@zonyitoo
Copy link
Author

The same as #18352

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

Successfully merging a pull request may close this issue.

1 participant