Hi there,
I'm doing this:
#[cfg(feature = "tls-rust")]
use tokio_rustls::{client::TlsStream, TlsConnector as TokioTlsConnector};
#[cfg(feature = "tls-native")]
use tokio_tls::{TlsConnector as TokioTlsConnector, TlsStream};
and the compiler is complaining about TokioTlsConnector
being defined multiple times:
error[E0252]: the name `TokioTlsConnector` is defined multiple times
--> src\conn.rs:36:17
|
34 | use tokio_rustls::{client::TlsStream, TlsConnector as TokioTlsConnector};
| --------------------------------- previous import of the type `TokioTlsConnector` here
35 | #[cfg(feature = "tls-native")]
36 | use tokio_tls::{TlsConnector as TokioTlsConnector, TlsStream};
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `TokioTlsConnector` reimported here
|
= note: `TokioTlsConnector` must be defined only once in the type namespace of this module
help: you can use `as` to change the binding name of the import
|
36 | use tokio_tls::{TlsConnector as OtherTokioTlsConnector, TlsStream};
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Why is that? Isn't #[cfg]
conditional compilation?