amethyst / amethyst-starter-2d

Seed project for 2D games
Other
201 stars 42 forks source link

Failed to build on MacOS Big Sur #31

Closed Axighi closed 2 years ago

Axighi commented 2 years ago
HEAD is now at f224b98 Update Cargo.toml
~/Dev/amethyst-starter-2d master ❯ git st
On branch master
Your branch is up to date with 'origin/master'.

nothing to commit, working tree clean
~/Dev/amethyst-starter-2d master ❯ vi Cargo.toml
~/Dev/amethyst-starter-2d master* 10s ❯ cargo run
    Updating crates.io index
   Compiling objc_exception v0.1.2
   Compiling spirv_cross v0.15.0
   Compiling serde v1.0.112
   Compiling failure_derive v0.1.8
   Compiling rusttype v0.8.3
   Compiling lexical-core v0.4.6
   Compiling tiff v0.2.2
   Compiling inventory v0.1.6
   Compiling unic-langid-macros v0.8.0
   Compiling tiff v0.3.1
   Compiling thiserror v1.0.19
   Compiling glsl-layout v0.3.2
   Compiling rental v0.5.5
   Compiling paste v0.1.16
   Compiling rayon v1.3.0
   Compiling rand_distr v0.2.2
   Compiling phf_codegen v0.7.24
   Compiling proc-macro-error v1.0.2
   Compiling coreaudio-sys v0.2.4
   Compiling twox-hash v1.5.0
error[E0308]: mismatched types
   --> /Users/azriel/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.4.6/src/atof/algorithm/bigcomp.rs:243:55
    |
243 |     let nlz = den.leading_zeros().wrapping_sub(wlz) & (u32::BITS - 1);
    |                                                       ^^^^^^^^^^^^^^^ expected `usize`, found `u32`

   Compiling lyon_path v0.14.0
error[E0277]: no implementation for `usize & u32`
   --> /Users/azriel/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.4.6/src/atof/algorithm/bigcomp.rs:243:53
    |
243 |     let nlz = den.leading_zeros().wrapping_sub(wlz) & (u32::BITS - 1);
    |                                                     ^ no implementation for `usize & u32`
    |
    = help: the trait `BitAnd<u32>` is not implemented for `usize`

error[E0308]: mismatched types
   --> /Users/azriel/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.4.6/src/atof/algorithm/bigcomp.rs:261:40
    |
261 |         let (q, r) = shift.ceil_divmod(Limb::BITS);
    |                                        ^^^^^^^^^^ expected `usize`, found `u32`
    |
help: you can convert a `u32` to a `usize` and panic if the converted value doesn't fit
    |
261 |         let (q, r) = shift.ceil_divmod(Limb::BITS.try_into().unwrap());
    |                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0308]: mismatched types
  --> /Users/azriel/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.4.6/src/atof/algorithm/bigint.rs:85:24
   |
85 |     let bytes = bits / Limb::BITS;
   |                        ^^^^^^^^^^ expected `usize`, found `u32`

error[E0277]: cannot divide `usize` by `u32`
  --> /Users/azriel/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.4.6/src/atof/algorithm/bigint.rs:85:22
   |
85 |     let bytes = bits / Limb::BITS;
   |                      ^ no implementation for `usize / u32`
   |
   = help: the trait `Div<u32>` is not implemented for `usize`

error[E0308]: mismatched types
    --> /Users/azriel/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.4.6/src/atof/algorithm/math.rs:1045:42
     |
1045 |     let mut count = index.saturating_mul(Limb::BITS);
     |                                          ^^^^^^^^^^ expected `usize`, found `u32`
     |
help: you can convert a `u32` to a `usize` and panic if the converted value doesn't fit
     |
1045 |     let mut count = index.saturating_mul(Limb::BITS.try_into().unwrap());
     |                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0308]: mismatched types
    --> /Users/azriel/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.4.6/src/atof/algorithm/math.rs:1060:28
     |
1060 |     Limb::BITS.checked_mul(x.len())
     |                            ^^^^^^^ expected `u32`, found `usize`
     |
help: you can convert a `usize` to a `u32` and panic if the converted value doesn't fit
     |
1060 |     Limb::BITS.checked_mul(x.len().try_into().unwrap())
     |                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0308]: mismatched types
    --> /Users/azriel/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.4.6/src/atof/algorithm/math.rs:1061:22
     |
1061 |         .map(|v| v - nlz)
     |                      ^^^ expected `u32`, found `usize`

error[E0277]: cannot subtract `usize` from `u32`
    --> /Users/azriel/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.4.6/src/atof/algorithm/math.rs:1061:20
     |
1061 |         .map(|v| v - nlz)
     |                    ^ no implementation for `u32 - usize`
     |
     = help: the trait `Sub<usize>` is not implemented for `u32`

error[E0308]: mismatched types
    --> /Users/azriel/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.4.6/src/atof/algorithm/math.rs:1062:20
     |
1062 |         .unwrap_or(usize::max_value())
     |                    ^^^^^^^^^^^^^^^^^^ expected `u32`, found `usize`
     |
help: you can convert a `usize` to a `u32` and panic if the converted value doesn't fit
     |
1062 |         .unwrap_or(usize::max_value().try_into().unwrap())
     |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0308]: mismatched types
    --> /Users/azriel/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.4.6/src/atof/algorithm/math.rs:1060:5
     |
1056 |   pub fn bit_length(x: &[Limb]) -> usize {
     |                                    ----- expected `usize` because of return type
...
1060 | /     Limb::BITS.checked_mul(x.len())
1061 | |         .map(|v| v - nlz)
1062 | |         .unwrap_or(usize::max_value())
     | |______________________________________^ expected `usize`, found `u32`
     |
help: you can convert a `u32` to a `usize` and panic if the converted value doesn't fit
     |
1060 |     Limb::BITS.checked_mul(x.len())
1061 |         .map(|v| v - nlz)
1062 |         .unwrap_or(usize::max_value()).try_into().unwrap()
     |

error[E0308]: mismatched types
    --> /Users/azriel/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.4.6/src/atof/algorithm/math.rs:1087:23
     |
1087 |     debug_assert!(n < bits && n != 0);
     |                       ^^^^ expected `usize`, found `u32`
     |
help: you can convert a `u32` to a `usize` and panic if the converted value doesn't fit
     |
1087 |     debug_assert!(n < bits.try_into().unwrap() && n != 0);
     |                       ^^^^^^^^^^^^^^^^^^^^^^^^

error[E0308]: mismatched types
    --> /Users/azriel/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.4.6/src/atof/algorithm/math.rs:1094:25
     |
1094 |     let lshift = bits - n;
     |                         ^ expected `u32`, found `usize`

error[E0277]: cannot subtract `usize` from `u32`
    --> /Users/azriel/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.4.6/src/atof/algorithm/math.rs:1094:23
     |
1094 |     let lshift = bits - n;
     |                       ^ no implementation for `u32 - usize`
     |
     = help: the trait `Sub<usize>` is not implemented for `u32`

error[E0308]: mismatched types
    --> /Users/azriel/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.4.6/src/atof/algorithm/math.rs:1135:19
     |
1135 |     let rem = n % bits;
     |                   ^^^^ expected `usize`, found `u32`

error[E0277]: cannot mod `usize` by `u32`
    --> /Users/azriel/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.4.6/src/atof/algorithm/math.rs:1135:17
     |
1135 |     let rem = n % bits;
     |                 ^ no implementation for `usize % u32`
     |
     = help: the trait `Rem<u32>` is not implemented for `usize`

error[E0308]: mismatched types
    --> /Users/azriel/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.4.6/src/atof/algorithm/math.rs:1136:19
     |
1136 |     let div = n / bits;
     |                   ^^^^ expected `usize`, found `u32`

error[E0277]: cannot divide `usize` by `u32`
    --> /Users/azriel/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.4.6/src/atof/algorithm/math.rs:1136:17
     |
1136 |     let div = n / bits;
     |                 ^ no implementation for `usize / u32`
     |
     = help: the trait `Div<u32>` is not implemented for `usize`

error[E0308]: mismatched types
    --> /Users/azriel/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.4.6/src/atof/algorithm/math.rs:1192:23
     |
1192 |     debug_assert!(n < bits);
     |                       ^^^^ expected `usize`, found `u32`
     |
help: you can convert a `u32` to a `usize` and panic if the converted value doesn't fit
     |
1192 |     debug_assert!(n < bits.try_into().unwrap());
     |                       ^^^^^^^^^^^^^^^^^^^^^^^^
 1 Cargo.toml                                                                                                                                                                                                         Buffers

error[E0308]: mismatched types
    --> /Users/azriel/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.4.6/src/atof/algorithm/math.rs:1202:25
     |
1202 |     let rshift = bits - n;
     |                         ^ expected `u32`, found `usize`

error[E0277]: cannot subtract `usize` from `u32`
    --> /Users/azriel/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.4.6/src/atof/algorithm/math.rs:1202:23
     |
1202 |     let rshift = bits - n;
     |                       ^ no implementation for `u32 - usize`
     |
     = help: the trait `Sub<usize>` is not implemented for `u32`

error[E0308]: mismatched types
    --> /Users/azriel/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.4.6/src/atof/algorithm/math.rs:1254:19
     |
1254 |     let rem = n % bits;
     |                   ^^^^ expected `usize`, found `u32`

error[E0277]: cannot mod `usize` by `u32`
    --> /Users/azriel/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.4.6/src/atof/algorithm/math.rs:1254:17
     |
1254 |     let rem = n % bits;
     |                 ^ no implementation for `usize % u32`
     |
     = help: the trait `Rem<u32>` is not implemented for `usize`

error[E0308]: mismatched types
    --> /Users/azriel/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.4.6/src/atof/algorithm/math.rs:1255:19
     |
1255 |     let div = n / bits;
     |                   ^^^^ expected `usize`, found `u32`

error[E0277]: cannot divide `usize` by `u32`
    --> /Users/azriel/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.4.6/src/atof/algorithm/math.rs:1255:17
     |
1255 |     let div = n / bits;
     |                 ^ no implementation for `usize / u32`
     |
     = help: the trait `Div<u32>` is not implemented for `usize`

error[E0308]: mismatched types
    --> /Users/azriel/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.4.6/src/atof/algorithm/math.rs:2066:27
     |
2066 |     let rs = Limb::BITS - s;
     |                           ^ expected `u32`, found `usize`

error[E0277]: cannot subtract `usize` from `u32`
    --> /Users/azriel/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.4.6/src/atof/algorithm/math.rs:2066:25
     |
2066 |     let rs = Limb::BITS - s;
     |                         ^ no implementation for `u32 - usize`
     |
     = help: the trait `Sub<usize>` is not implemented for `u32`

Some errors have detailed explanations: E0277, E0308.
For more information about an error, try `rustc --explain E0277`.
error: could not compile `lexical-core` due to 27 previous errors
warning: build failed, waiting for other jobs to finish...
error: build failed
cohensh commented 2 years ago

I get the same errors on Linux after cloning, apt-get installing out of the readme, and cargo run

$ uname -a
Linux pop-os 5.11.0-7614-generic #15~1622578982~20.10~383c0a9-Ubuntu SMP Wed Jun 2 00:54:41 UTC 2 x86_64 x86_64 x86_64 GNU/Linux
$ git rev-parse HEAD
f224b98f1c2baedc0ac672038a0d39206cadb624
mibes commented 2 years ago

I managed to get the template project to run by adding lexical-core = "0.4.8" to the [dependencies] and running cargo update.

MacOS version 11.6
rustc 1.56.0 (09c42c458 2021-10-18)
Axighi commented 2 years ago

I managed to get the template project to run by adding lexical-core = "0.4.8" to the [dependencies] and running cargo update.

MacOS version 11.6
rustc 1.56.0 (09c42c458 2021-10-18)

This solves the problem