serenity icon indicating copy to clipboard operation
serenity copied to clipboard

Fail to compile with rustls_backend if used as a dependency of a dependency.

Open vicky5124 opened this issue 5 years ago • 1 comments
trafficstars

Serenity will fail to compile if the library that depends on it uses the rustls_backend feature, and if the bot that uses that library also has rustls_backend. If either the library, the bot or both have native_tls_backend, serenity compiles just fine.

An easy example for this is Serenity-LavaLink Where it must use native_tls_backend, because if it uses rustls_backend and a bot uses it with also rustls_backend, serenity will not compile.

Error:

   Compiling serenity v0.8.6 (https://github.com/Lakelezz/serenity/?branch=await#9027d501)
error[E0308]: mismatched types
   --> /home/nitsuga/.cargo/git/checkouts/serenity-ef455b216c151cd1/9027d50/src/internal/ws_impl.rs:166:8
    |
166 |     Ok(stream)
    |        ^^^^^^ expected struct `async_tls::client::TlsStream`, found struct `async_tungstenite::tokio::TokioAdapter`
    |
    = note: expected struct `async_tungstenite::WebSocketStream<async_tungstenite::stream::Stream<_, async_tls::client::TlsStream<async_tungstenite::tokio::TokioAdapter<tokio::net::tcp::stream::TcpStream>>>>`
               found struct `async_tungstenite::WebSocketStream<async_tungstenite::stream::Stream<_, async_tungstenite::tokio::TokioAdapter<tokio_tls::TlsStream<async_tungstenite::tokio::TokioAdapter<async_tungstenite::tokio::TokioAdapter<tokio::net::tcp::stream::TcpStream>>>>>>`

vicky5124 avatar May 21 '20 23:05 vicky5124

I'm not sure I understand what you mean. So there's crates

  • bot: depends on library, depends on serenity with feature "rustls_backend"
  • library: depends on serenity with feature "rustls_backend"
  • serenity

And in this setup serenity fails to compile? That'd be very weird because as far as I know it makes zero difference for a crate (here: serenity) who activated its features; it only knows that the features are activated.

kangalio avatar Sep 17 '22 09:09 kangalio

Can't reproduce & no response from author serenity-870-test.zip

kangalio avatar Apr 07 '23 16:04 kangalio