servo / euclid

Geometry primitives (basic linear algebra) for Rust
Other
462 stars 102 forks source link

Fails to compile with --no-default-features #467

Closed notgull closed 1 year ago

notgull commented 3 years ago
$ cargo build --no-default-features
    Updating crates.io index
   Compiling autocfg v1.0.1
   Compiling num-traits v0.2.12
   Compiling euclid v0.22.1 (/home/darkstar/Programming/Projects/euclid)
error[E0432]: unresolved import `num_traits::Float`
  --> src/angle.rs:15:18
   |
15 | use num_traits::{Float, FloatConst, NumCast, One, Zero};
   |                  ^^^^^
   |                  |
   |                  no `Float` in the root
   |                  help: a similar name exists in the module (notice the capitalization): `float`

error[E0432]: unresolved import `num_traits::Float`
  --> src/point.rs:25:18
   |
25 | use num_traits::{Float, NumCast};
   |                  ^^^^^
   |                  |
   |                  no `Float` in the root
   |                  help: a similar name exists in the module (notice the capitalization): `float`

error[E0432]: unresolved import `num_traits::Float`
 --> src/rigid.rs:8:5
  |
8 | use num_traits::Float;
  |     ^^^^^^^^^^^^-----
  |     |           |
  |     |           help: a similar name exists in the module (notice the capitalization): `float`
  |     no `Float` in the root

error[E0432]: unresolved import `num_traits::Float`
  --> src/rotation.rs:19:18
   |
19 | use num_traits::{Float, NumCast, One, Zero};
   |                  ^^^^^
   |                  |
   |                  no `Float` in the root
   |                  help: a similar name exists in the module (notice the capitalization): `float`

error[E0432]: unresolved import `num_traits::Float`
  --> src/vector.rs:29:18
   |
29 | use num_traits::{Float, NumCast, Signed};
   |                  ^^^^^
   |                  |
   |                  no `Float` in the root
   |                  help: a similar name exists in the module (notice the capitalization): `float`

error[E0433]: failed to resolve: could not find `Float` in `num_traits`
  --> src/approxeq.rs:35:29
   |
35 |                 num_traits::Float::abs(*self - *other) < *approx_epsilon
   |                             ^^^^^ could not find `Float` in `num_traits`
...
41 | approx_eq!(f32, 1.0e-6);
   | ------------------------ in this macro invocation
   |
   = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0433]: failed to resolve: could not find `Float` in `num_traits`
  --> src/approxeq.rs:35:29
   |
35 |                 num_traits::Float::abs(*self - *other) < *approx_epsilon
   |                             ^^^^^ could not find `Float` in `num_traits`
...
42 | approx_eq!(f64, 1.0e-6);
   | ------------------------ in this macro invocation
   |
   = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0433]: failed to resolve: could not find `Float` in `num_traits`
   --> src/num.rs:107:29
    |
107 |                 num_traits::Float::floor(self)
    |                             ^^^^^ could not find `Float` in `num_traits`
...
127 | num_float!(f32);
    | ---------------- in this macro invocation
    |
    = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0433]: failed to resolve: could not find `Float` in `num_traits`
   --> src/num.rs:113:29
    |
113 |                 num_traits::Float::ceil(self)
    |                             ^^^^^ could not find `Float` in `num_traits`
...
127 | num_float!(f32);
    | ---------------- in this macro invocation
    |
    = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0433]: failed to resolve: could not find `Float` in `num_traits`
   --> src/num.rs:107:29
    |
107 |                 num_traits::Float::floor(self)
    |                             ^^^^^ could not find `Float` in `num_traits`
...
128 | num_float!(f64);
    | ---------------- in this macro invocation
    |
    = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0433]: failed to resolve: could not find `Float` in `num_traits`
   --> src/num.rs:113:29
    |
113 |                 num_traits::Float::ceil(self)
    |                             ^^^^^ could not find `Float` in `num_traits`
...
128 | num_float!(f64);
    | ---------------- in this macro invocation
    |
    = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0433]: failed to resolve: could not find `Float` in `num_traits`
  --> src/trig.rs:25:29
   |
25 |                 num_traits::Float::sin(self)
   |                             ^^^^^ could not find `Float` in `num_traits`
...
79 | trig!(f32);
   | ----------- in this macro invocation
   |
   = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0433]: failed to resolve: could not find `Float` in `num_traits`
  --> src/trig.rs:29:29
   |
29 |                 num_traits::Float::cos(self)
   |                             ^^^^^ could not find `Float` in `num_traits`
...
79 | trig!(f32);
   | ----------- in this macro invocation
   |
   = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0433]: failed to resolve: could not find `Float` in `num_traits`
  --> src/trig.rs:33:29
   |
33 |                 num_traits::Float::tan(self)
   |                             ^^^^^ could not find `Float` in `num_traits`
...
79 | trig!(f32);
   | ----------- in this macro invocation
   |
   = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0433]: failed to resolve: could not find `Float` in `num_traits`
  --> src/trig.rs:47:41
   |
47 |                 let x_abs = num_traits::Float::abs(x);
   |                                         ^^^^^ could not find `Float` in `num_traits`
...
79 | trig!(f32);
   | ----------- in this macro invocation
   |
   = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0433]: failed to resolve: could not find `Float` in `num_traits`
  --> src/trig.rs:48:41
   |
48 |                 let y_abs = num_traits::Float::abs(y);
   |                                         ^^^^^ could not find `Float` in `num_traits`
...
79 | trig!(f32);
   | ----------- in this macro invocation
   |
   = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0433]: failed to resolve: could not find `Float` in `num_traits`
  --> src/trig.rs:25:29
   |
25 |                 num_traits::Float::sin(self)
   |                             ^^^^^ could not find `Float` in `num_traits`
...
80 | trig!(f64);
   | ----------- in this macro invocation
   |
   = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0433]: failed to resolve: could not find `Float` in `num_traits`
  --> src/trig.rs:29:29
   |
29 |                 num_traits::Float::cos(self)
   |                             ^^^^^ could not find `Float` in `num_traits`
...
80 | trig!(f64);
   | ----------- in this macro invocation
   |
   = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0433]: failed to resolve: could not find `Float` in `num_traits`
  --> src/trig.rs:33:29
   |
33 |                 num_traits::Float::tan(self)
   |                             ^^^^^ could not find `Float` in `num_traits`
...
80 | trig!(f64);
   | ----------- in this macro invocation
   |
   = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0433]: failed to resolve: could not find `Float` in `num_traits`
  --> src/trig.rs:47:41
   |
47 |                 let x_abs = num_traits::Float::abs(x);
   |                                         ^^^^^ could not find `Float` in `num_traits`
...
80 | trig!(f64);
   | ----------- in this macro invocation
   |
   = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0433]: failed to resolve: could not find `Float` in `num_traits`
  --> src/trig.rs:48:41
   |
48 |                 let y_abs = num_traits::Float::abs(y);
   |                                         ^^^^^ could not find `Float` in `num_traits`
...
80 | trig!(f64);
   | ----------- in this macro invocation
   |
   = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

error: aborting due to 21 previous errors

Some errors have detailed explanations: E0432, E0433.
For more information about an error, try `rustc --explain E0432`.
error: could not compile `euclid`.

To learn more, run the command again with --verbose.

Currently writing a PR to try to fix this.

ArtHome12 commented 1 year ago

@notgull Can you please tell me why you changed your mind about submitting this PR?

I think along with it, you should also make changes to the build test script in .github\workflows\main.yml at line 15: features: ["", "--features serde", "--no-default-features --features libm", "--no-default-features"]

notgull commented 1 year ago

I forgot about this issue, sorry!

It looks like it builds now with --no-default-features --features libm, so I'll close this issue now.