fu5ha / ultraviolet

A wide linear algebra crate for games and graphics.
https://crates.io/crates/ultraviolet
750 stars 81 forks source link

Compile error from missing wide traits. #81

Closed mohaque0 closed 4 years ago

mohaque0 commented 4 years ago

Hi. I get a number of compile errors when attempting to run cargo build and also when attempting to use ultraviolet as a dependency in a project. All of the errors look similar.

Here is an example error:

error[E0599]: no method named `cmp_ge` found for struct `wide::f32x4` in the current scope
  --> src/util.rs:32:19
   |
32 |                 r.cmp_ge(eps).none()
   |                   ^^^^^^ method not found in `wide::f32x4`
...
38 | impl_eq_eps_wide!(f32x4, f32x8, f64x2, f64x4);
   | ---------------------------------------------- in this macro invocation
   |
   = help: items from traits can only be used if the trait is in scope
   = note: the following trait is implemented but not in scope; perhaps add a `use` for it:
           `use wide::CmpGe;`
   = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

I'm able to fix them by applying the following diff:

diff --git a/src/lib.rs b/src/lib.rs
index 8f37eba..fe000f2 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -120,6 +120,7 @@ pub use transform::*;
 pub use vec::*;

 pub(crate) use wide;
+use wide::*;

 pub use wide::f32x4;
 pub use wide::f32x8;

Was that statement missing or am I doing something wrong somewhere?

fu5ha commented 4 years ago

Hm. It seems like you might have just gotten unlucky and are somehow being given a yanked version of wide (looks like they released a semver breaking change as a patch version but have already yanked it...

try a cargo update and see if it'll fetch a non broken version

mohaque0 commented 4 years ago

That worked! It's compiling just fine now. Thanks for helping!

fu5ha commented 4 years ago

Great, closing this then :)