granne / granne

Graph-based Approximate Nearest Neighbor Search

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error building Python module with nightly

tillbey opened this issue · comments

First of all: Great work with Granne, absolutely impressive performance!

Unfortunately I have been getting an error trying to build the Python module with the latest commits.

error[E0308]: mismatched types
      --> src/elements/dense_vector.rs:86:17
       |
    86 |                 Self(self.0.into_owned())
       |                 ^^^^^^^^^^^^^^^^^^^^^^^^^ lifetime mismatch
       |
      ::: src/elements/angular.rs:53:1
       |
    53 | dense_vector!(f32);
       | ------------------- in this macro invocation
       |
       = note: expected struct `elements::angular::Vectors<'static>`
                  found struct `elements::angular::Vectors<'a>`
    note: the lifetime `'a` as defined on the impl at 40:14...
      --> src/elements/dense_vector.rs:40:14
       |
    40 |         impl<'a> Vectors<'a> {
       |              ^^
       |
      ::: src/elements/angular.rs:53:1
       |
    53 | dense_vector!(f32);
       | ------------------- in this macro invocation
       = note: ...does not necessarily outlive the static lifetime
       = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
    
    error[E0308]: mismatched types
      --> src/elements/dense_vector.rs:86:17
       |
    86 |                 Self(self.0.into_owned())
       |                 ^^^^^^^^^^^^^^^^^^^^^^^^^ lifetime mismatch
       |
      ::: src/elements/angular_int.rs:17:1
       |
    17 | dense_vector!(i8);
       | ------------------ in this macro invocation
       |
       = note: expected struct `elements::angular_int::Vectors<'static>`
                  found struct `elements::angular_int::Vectors<'a>`
    note: the lifetime `'a` as defined on the impl at 40:14...
      --> src/elements/dense_vector.rs:40:14
       |
    40 |         impl<'a> Vectors<'a> {
       |              ^^
       |
      ::: src/elements/angular_int.rs:17:1
       |
    17 | dense_vector!(i8);
       | ------------------ in this macro invocation
       = note: ...does not necessarily outlive the static lifetime
       = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
    
    error: aborting due to 2 previous errors
    
    For more information about this error, try `rustc --explain E0308`.
    error: could not compile `granne`.

I could narrow it down to 7de618b. It seems that there is an issue with using nightly, as cargo +nightly bench gives a similar error already with earlier commits. I would love to get deeper into this but alas my knowledge of Rust is definitely only superficial.

commented

Thanks for reporting this issue. I hope it should be fixed by #11 . Let me know if it was not.

yes, that fixes it. Thanks