Dependency version conflict

Hi!

I'm hit by this:

expected struct `rustls::anchors::RootCertStore`, found a different struct `rustls::anchors::RootCertStore`
    |
    = note: perhaps two different versions of crate `rustls` are being used?

A dependency is using rustls:0.17.0 and another is pulling in rustls:0.18.1 causing this message.
I though dependency hell wasn't a thing in Rust? What am I missing here?

Thanks!

found why: rustls depends on ring which is not pure Rust, hence version conflict

Cargo tries to unify versions whenever possible. In this case it is not possible. Normally this is not a problem, and both versions will just co-exist. However when you have a crate that gets a value of one version through one way and try to use it on a function of the other version, this will result in an error. This problem can only happen when a dependency has rustls as public dependency and you or another dependency that also has rustls as public dependency depends on a different version yourself.

Thanks for the explanation!

Indeed:
ldap3:0.7.1 has rustls:0.17.0
I tried rustls-native-certs:0.4.0 which pulls rustls:0.18.1
and my app tried to pull rustls:0.18.1

I'll wait for ldap3 to update :slight_smile:

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.