Brendonovich / prisma-client-rust

Type-safe database access for Rust
https://prisma.brendonovich.dev
Apache License 2.0
1.75k stars 106 forks source link

Build errors from Tiberius dep #313

Closed tracy-codes closed 1 year ago

tracy-codes commented 1 year ago

Getting the following errors from the Tiberius dependency of quaint (https://github.com/Brendonovich/quaint) when attempting cargo build or cargo build --release or cargo prisma <cmd>:

   Compiling tiberius v0.11.6
error[E0428]: the name `create_tls_stream` is defined multiple times
  --> /redacted/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tiberius-0.11.6/src/client/tls_stream.rs:39:1
   |
31 | / pub(crate) async fn create_tls_stream<S: AsyncRead + AsyncWrite + Unpin + Send>(
32 | |     config: &Config,
33 | |     stream: S,
34 | | ) -> crate::Result<TlsStream<S>> {
35 | |     native_tls_stream::create_tls_stream(config, stream).await
36 | | }
   | |_- previous definition of the value `create_tls_stream` here
...
39 | / pub(crate) async fn create_tls_stream<S: AsyncRead + AsyncWrite + Unpin + Send>(
40 | |     config: &Config,
41 | |     stream: S,
42 | | ) -> crate::Result<TlsStream<S>> {
43 | |     opentls_tls_stream::create_tls_stream(config, stream).await
44 | | }
   | |_^ `create_tls_stream` redefined here
   |
   = note: `create_tls_stream` must be defined only once in the value namespace of this module

error[E0252]: the name `TlsStream` is defined multiple times
  --> /redacted/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tiberius-0.11.6/src/client/tls_stream.rs:20:16
   |
14 | pub(crate) use native_tls_stream::TlsStream;
   |                ---------------------------- previous import of the type `TlsStream` here
...
20 | pub(crate) use opentls_tls_stream::TlsStream;
   |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `TlsStream` reimported here
   |
   = note: `TlsStream` 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
   |
20 | pub(crate) use opentls_tls_stream::TlsStream as OtherTlsStream;
   |                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

error[E0308]: mismatched types
  --> /redacted/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tiberius-0.11.6/src/client/tls_stream.rs:43:5
   |
43 |     opentls_tls_stream::create_tls_stream(config, stream).await
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `async_native_tls::TlsStream<S>`, found `opentls::async_io::TlsStream<S>`
   |
   = note: `opentls::async_io::TlsStream<S>` and `async_native_tls::TlsStream<S>` have similar names, but are actually distinct types
note: `opentls::async_io::TlsStream<S>` is defined in crate `opentls`
  --> /redacted/.cargo/registry/src/index.crates.io-6f17d22bba15001f/opentls-0.2.1/src/async_io/stream.rs:26:1
   |
26 | pub struct TlsStream<S>(sync_io::TlsStream<StdAdapter<S>>);
   | ^^^^^^^^^^^^^^^^^^^^^^^
note: `async_native_tls::TlsStream<S>` is defined in crate `async_native_tls`
  --> /redacted/.cargo/registry/src/index.crates.io-6f17d22bba15001f/async-native-tls-0.4.0/src/tls_stream.rs:20:1
   |
20 | pub struct TlsStream<S>(native_tls::TlsStream<StdAdapter<S>>);
   | ^^^^^^^^^^^^^^^^^^^^^^^

Some errors have detailed explanations: E0252, E0308, E0428.
For more information about an error, try `rustc --explain E0252`.
error: could not compile `tiberius` (lib) due to 3 previous errors

Steps taken to attempt to resolve:

Env details:

tracy-codes commented 1 year ago

Resolved by adding resolver = "2" to my Cargo.toml