serenity
serenity copied to clipboard
Fail to compile with rustls_backend if used as a dependency of a dependency.
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>>>>>>`
I'm not sure I understand what you mean. So there's crates
bot: depends onlibrary, depends onserenitywith feature "rustls_backend"library: depends onserenitywith 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.
Can't reproduce & no response from author serenity-870-test.zip