amethyst / evoli

An ecosystem-simulation game made with Amethyst
https://community.amethyst.rs/t/evoli-introduction/770
Other
217 stars 33 forks source link

doesn't compile with Rust 1.56.0 #118

Open Frank-Buss opened 2 years ago

Frank-Buss commented 2 years ago

I cloned the repository, then I did a "cargo run". I get these compiler errors:

   Compiling proc-macro-error-attr v1.0.3
error[E0308]: mismatched types
   --> /home/frank/.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`

error[E0277]: no implementation for `usize & u32`
   --> /home/frank/.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
   --> /home/frank/.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
  --> /home/frank/.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`
  --> /home/frank/.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
    --> /home/frank/.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
    --> /home/frank/.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
    --> /home/frank/.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`
    --> /home/frank/.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
    --> /home/frank/.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
    --> /home/frank/.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
    --> /home/frank/.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
    --> /home/frank/.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`
    --> /home/frank/.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
    --> /home/frank/.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`
    --> /home/frank/.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
    --> /home/frank/.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`
    --> /home/frank/.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
    --> /home/frank/.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());
     |                       ~~~~~~~~~~~~~~~~~~~~~~~~

error[E0308]: mismatched types
    --> /home/frank/.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`
    --> /home/frank/.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
    --> /home/frank/.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`
    --> /home/frank/.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
    --> /home/frank/.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`
    --> /home/frank/.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
    --> /home/frank/.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`
    --> /home/frank/.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