Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DashMap uses private serde module #133

Closed
thomcc opened this issue Jan 12, 2021 · 5 comments
Closed

DashMap uses private serde module #133

thomcc opened this issue Jan 12, 2021 · 5 comments

Comments

@thomcc
Copy link

thomcc commented Jan 12, 2021

If I attempt cargo install tokei, when building dashmap it fails with this error:

error[E0603]: module `export` is private
   --> /Users/thom/.cargo/registry/src/github.com-1ecc6299db9ec823/dashmap-3.11.10/src/serde.rs:5:12
    |
5   | use serde::export::PhantomData;
    |            ^^^^^^ private module
    |
note: the module `export` is defined here
   --> /Users/thom/.cargo/registry/src/github.com-1ecc6299db9ec823/serde-1.0.119/src/lib.rs:275:5
    |
275 | use self::__private as export;
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0282]: type annotations needed
  --> /Users/thom/.cargo/registry/src/github.com-1ecc6299db9ec823/dashmap-3.11.10/src/serde.rs:58:38
   |
58 |         deserializer.deserialize_map(DashMapVisitor::<K, V>::new())
   |                                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot infer type for type parameter `K`

error: aborting due to 2 previous errors

This is presumably the case for anything else using dashmap, at least with serde support.

The issue seems to be https://github.com/xacrimon/dashmap/blob/master/src/serde.rs#L5 which imports from a private module. You should instead use core::marker::PhantomData which is the same.

Ideally, you could fix this and also backport the fix to 3.x, e.g. cut a new patch release of 3.11.11 that contains just this minor fix, which will fix everything that is still depending on dashmap v3. (Obviously, you should also fix it for 4.x)

@thomcc
Copy link
Author

thomcc commented Jan 12, 2021

This change happened in the most recent version of serde, e.g. in this commit serde-rs/serde@dd1f4b4

@ryzhyk
Copy link

ryzhyk commented Jan 12, 2021

Serde 1.0.119 broke semantic versioning by removing some std re-exports. I ran into the same issue with my project. Unfortunately, they wouldn't fix it: serde-rs/serde#1946

@thomcc
Copy link
Author

thomcc commented Jan 12, 2021

I think serde's stance is reasonable, although I'd assume stuff like this can happen due to cargo fix suggestions and/or r-a autoimport, so I'd probably be a bit more sympathetic.

Either way, it needs to be fixed downstream in crates like this one.

@nvzqz
Copy link

nvzqz commented Jan 12, 2021

@xacrimon can you please also release 3.11.11 with this fix, so that downstream crates aren't required to update to 4.x (for 4.0.2)?

danalex97 pushed a commit to danalex97/eden that referenced this issue Feb 12, 2021
Summary:
Pull Request resolved: facebook/relay#3355

Followed [this guide](https://www.internalfb.com/intern/wiki/Rust-at-facebook/Managing_fbsource_third-party_with_Reindeer/) to update the dependecies.

For more context on serde error fixed by this update, check this xacrimon/dashmap#133

Differential Revision: D26423198

fbshipit-source-id: f057350488367fd7c0cdf27d4bbd575473c3c7ae
facebook-github-bot pushed a commit to facebook/sapling that referenced this issue Feb 12, 2021
Summary:
Pull Request resolved: #73

Pull Request resolved: facebook/relay#3355

Followed [this guide](https://www.internalfb.com/intern/wiki/Rust-at-facebook/Managing_fbsource_third-party_with_Reindeer/) to update the dependecies.

For more context on serde error fixed by this update, check this xacrimon/dashmap#133

Differential Revision: D26423198

fbshipit-source-id: 1a98ffe84d423bd9417a9b3049044dac01639637
@doivosevic
Copy link

any update on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants