ritchie46 / lsh-rs

Locality Sensitive Hashing in Rust with Python bindings
MIT License
109 stars 20 forks source link

Rust compilation error based on potentially broken serde API #16

Open homer6 opened 1 year ago

homer6 commented 1 year ago

I ran into this error with the latest version of lsh-rs:

   Compiling lsh-rs v0.4.0
error[E0432]: unresolved import `serde::export`
 --> C:\Users\steve\.cargo\registry\src\index.crates.io-6f17d22bba15001f\lsh-rs-0.4.0\src\hash.rs:8:12
  |
8 | use serde::export::PhantomData;
  |            ^^^^^^ could not find `export` in `serde`

error[E0433]: failed to resolve: could not find `export` in `serde`
 --> C:\Users\steve\.cargo\registry\src\index.crates.io-6f17d22bba15001f\lsh-rs-0.4.0\src\data.rs:4:12
  |
4 | use serde::export::fmt::{Debug, Display};
  |            ^^^^^^ could not find `export` in `serde`

error[E0432]: unresolved import `serde::export`
 --> C:\Users\steve\.cargo\registry\src\index.crates.io-6f17d22bba15001f\lsh-rs-0.4.0\src\table\sqlite.rs:9:12
  |
9 | use serde::export::PhantomData;
  |            ^^^^^^ could not find `export` in `serde`

Some errors have detailed explanations: E0432, E0433.
For more information about an error, try `rustc --explain E0432`.
error: could not compile `lsh-rs` (lib) due to 3 previous errors
warning: build failed, waiting for other jobs to finish...

I was running the latest serde:

serde = { version = "1.0.187", features = ["derive"] }

Based on this post, I downgraded to serde 1.0.118 and it compiled:

serde = { version = "=1.0.118", features = ["derive"] }

Maybe we need to update lsh-rs to be compatible with their new API?