Hey
I updated Rust but didn't change anything in my code. Suddenly I get a bunch of errors in code I didn't even write.
Most of the errors are of this type:
error[E0308]: mismatched types
--> /Users/niel/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.7.4/src/atof/algorithm/math.rs:2065:27
|
2065 | let rs = Limb::BITS - s;
| ^ expected `u32`, found `usize`
All errors:
error[E0308]: mismatched types
--> /Users/niel/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.7.4/src/atof/algorithm/bhcomp.rs:62:24
|
62 | let bytes = bits / Limb::BITS;
| ^^^^^^^^^^ expected `usize`, found `u32`
Compiling scheduled-thread-pool v0.2.5
error[E0277]: cannot divide `usize` by `u32`
--> /Users/niel/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.7.4/src/atof/algorithm/bhcomp.rs:62:22
|
62 | 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/niel/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.7.4/src/atof/algorithm/bigcomp.rs:157:55
|
157 | let nlz = den.leading_zeros().wrapping_sub(wlz) & (u32::BITS - 1);
| ^^^^^^^^^^^^^^^ expected `usize`, found `u32`
error[E0277]: no implementation for `usize & u32`
--> /Users/niel/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.7.4/src/atof/algorithm/bigcomp.rs:157:53
|
157 | 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/niel/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.7.4/src/atof/algorithm/bigcomp.rs:175:40
|
175 | 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
|
175 | let (q, r) = shift.ceil_divmod(Limb::BITS.try_into().unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Compiling backtrace v0.3.56
error[E0308]: mismatched types
--> /Users/niel/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.7.4/src/atof/algorithm/math.rs:1043:42
|
1043 | 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
|
1043 | let mut count = index.saturating_mul(Limb::BITS.try_into().unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0308]: mismatched types
--> /Users/niel/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.7.4/src/atof/algorithm/math.rs:1058:28
|
1058 | 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
|
1058 | Limb::BITS.checked_mul(x.len().try_into().unwrap())
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0308]: mismatched types
--> /Users/niel/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.7.4/src/atof/algorithm/math.rs:1059:22
|
1059 | .map(|v| v - nlz)
| ^^^ expected `u32`, found `usize`
error[E0277]: cannot subtract `usize` from `u32`
--> /Users/niel/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.7.4/src/atof/algorithm/math.rs:1059:20
|
1059 | .map(|v| v - nlz)
| ^ no implementation for `u32 - usize`
|
= help: the trait `Sub<usize>` is not implemented for `u32`
error[E0308]: mismatched types
--> /Users/niel/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.7.4/src/atof/algorithm/math.rs:1060:20
|
1060 | .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
|
1060 | .unwrap_or(usize::max_value().try_into().unwrap())
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0308]: mismatched types
--> /Users/niel/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.7.4/src/atof/algorithm/math.rs:1058:5
|
1054 | pub fn bit_length(x: &[Limb]) -> usize {
| ----- expected `usize` because of return type
...
1058 | / Limb::BITS.checked_mul(x.len())
1059 | | .map(|v| v - nlz)
1060 | | .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
|
1058 | Limb::BITS.checked_mul(x.len())
1059 | .map(|v| v - nlz)
1060 | .unwrap_or(usize::max_value()).try_into().unwrap()
|
error[E0308]: mismatched types
--> /Users/niel/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.7.4/src/atof/algorithm/math.rs:1085:23
|
1085 | 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
|
1085 | debug_assert!(n < bits.try_into().unwrap() && n != 0);
| ^^^^^^^^^^^^^^^^^^^^^^^^
error[E0308]: mismatched types
--> /Users/niel/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.7.4/src/atof/algorithm/math.rs:1092:25
|
1092 | let lshift = bits - n;
| ^ expected `u32`, found `usize`
error[E0277]: cannot subtract `usize` from `u32`
--> /Users/niel/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.7.4/src/atof/algorithm/math.rs:1092:23
|
1092 | let lshift = bits - n;
| ^ no implementation for `u32 - usize`
|
= help: the trait `Sub<usize>` is not implemented for `u32`
error[E0308]: mismatched types
--> /Users/niel/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.7.4/src/atof/algorithm/math.rs:1134:19
|
1134 | let rem = n % bits;
| ^^^^ expected `usize`, found `u32`
error[E0277]: cannot mod `usize` by `u32`
--> /Users/niel/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.7.4/src/atof/algorithm/math.rs:1134:17
|
1134 | let rem = n % bits;
| ^ no implementation for `usize % u32`
|
= help: the trait `Rem<u32>` is not implemented for `usize`
error[E0308]: mismatched types
--> /Users/niel/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.7.4/src/atof/algorithm/math.rs:1135:19
|
1135 | let div = n / bits;
| ^^^^ expected `usize`, found `u32`
error[E0277]: cannot divide `usize` by `u32`
--> /Users/niel/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.7.4/src/atof/algorithm/math.rs:1135:17
|
1135 | let div = n / bits;
| ^ no implementation for `usize / u32`
|
= help: the trait `Div<u32>` is not implemented for `usize`
error[E0308]: mismatched types
--> /Users/niel/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.7.4/src/atof/algorithm/math.rs:1191:23
|
1191 | 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
|
1191 | debug_assert!(n < bits.try_into().unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^^
error[E0308]: mismatched types
--> /Users/niel/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.7.4/src/atof/algorithm/math.rs:1201:25
|
1201 | let rshift = bits - n;
| ^ expected `u32`, found `usize`
error[E0277]: cannot subtract `usize` from `u32`
--> /Users/niel/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.7.4/src/atof/algorithm/math.rs:1201:23
|
1201 | let rshift = bits - n;
| ^ no implementation for `u32 - usize`
|
= help: the trait `Sub<usize>` is not implemented for `u32`
error[E0308]: mismatched types
--> /Users/niel/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.7.4/src/atof/algorithm/math.rs:1253:19
|
1253 | let rem = n % bits;
| ^^^^ expected `usize`, found `u32`
error[E0277]: cannot mod `usize` by `u32`
--> /Users/niel/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.7.4/src/atof/algorithm/math.rs:1253:17
|
1253 | let rem = n % bits;
| ^ no implementation for `usize % u32`
|
= help: the trait `Rem<u32>` is not implemented for `usize`
error[E0308]: mismatched types
--> /Users/niel/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.7.4/src/atof/algorithm/math.rs:1254:19
|
1254 | let div = n / bits;
| ^^^^ expected `usize`, found `u32`
error[E0277]: cannot divide `usize` by `u32`
--> /Users/niel/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.7.4/src/atof/algorithm/math.rs:1254:17
|
1254 | let div = n / bits;
| ^ no implementation for `usize / u32`
|
= help: the trait `Div<u32>` is not implemented for `usize`
error[E0308]: mismatched types
--> /Users/niel/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.7.4/src/atof/algorithm/math.rs:2065:27
|
2065 | let rs = Limb::BITS - s;
| ^ expected `u32`, found `usize`
error[E0277]: cannot subtract `usize` from `u32`
--> /Users/niel/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.7.4/src/atof/algorithm/math.rs:2065:25
|
2065 | let rs = Limb::BITS - s;
| ^ no implementation for `u32 - usize`
|
= help: the trait `Sub<usize>` is not implemented for `u32`
error: aborting due to 27 previous errors
Some errors have detailed explanations: E0277, E0308.
For more information about an error, try `rustc --explain E0277`.
error: could not compile `lexical-core`
To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...
error: build failed
I think this is an error in Rust itself or in the library lexical-core
. How do I fix it?
Thanks!