newsboat: Compilation errors for newsboat 2.24 (rustc --version = 1.53.0-beta.12)

Got a source package from the newsboat.org site. Did configure and make:

$ ./config.sh
Checking for package sqlite3... found
Checking for package libcurl... found
Checking for package libxml-2.0... found
Checking for package stfl... found
Checking for package json... not found
Checking for package json-c... found
Checking for package ncursesw... found

make


     Running `rustc --crate-name lexical_core --edition=2018 /home/user/.cargo/registry/src/github.com-1285ae84e5963aae/lexical-core-0.7.4/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C embed-bitcode=no --cfg 'feature="arrayvec"' --cfg 'feature="correct"' --cfg 'feature="default"' --cfg 'feature="ryu"' --cfg 'feature="static_assertions"' --cfg 'feature="std"' --cfg 'feature="table"' -C metadata=617a5463c7b0e3db -C extra-filename=-617a5463c7b0e3db --out-dir /home/user/zzz/newsboat-2.22.1/target/release/deps -L dependency=/home/user/zzz/newsboat-2.22.1/target/release/deps --extern arrayvec=/home/user/zzz/newsboat-2.22.1/target/release/deps/libarrayvec-af7e05f2f1778834.rmeta --extern bitflags=/home/user/zzz/newsboat-2.22.1/target/release/deps/libbitflags-0be668c34e4d7ff1.rmeta --extern cfg_if=/home/user/zzz/newsboat-2.22.1/target/release/deps/libcfg_if-a5574b329cfb54e6.rmeta --extern ryu=/home/user/zzz/newsboat-2.22.1/target/release/deps/libryu-8370e97f448acf1f.rmeta --extern static_assertions=/home/user/zzz/newsboat-2.22.1/target/release/deps/libstatic_assertions-9cc936ccc713e0fa.rmeta --cap-lints allow --cfg limb_width_32`
error[E0308]: mismatched types
  --> /home/user/.cargo/registry/src/github.com-1285ae84e5963aae/lexical-core-0.7.4/src/atof/algorithm/bhcomp.rs:62:24
   |
62 |     let bytes = bits / Limb::BITS;
   |                        ^^^^^^^^^^ expected `usize`, found `u32`

error[E0277]: cannot divide `usize` by `u32`
  --> /home/user/.cargo/registry/src/github.com-1285ae84e5963aae/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
   --> /home/user/.cargo/registry/src/github.com-1285ae84e5963aae/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`
   --> /home/user/.cargo/registry/src/github.com-1285ae84e5963aae/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
   --> /home/user/.cargo/registry/src/github.com-1285ae84e5963aae/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 rand_core v0.5.1
     Running `rustc --crate-name rand_core --edition=2018 /home/user/.cargo/registry/src/github.com-1285ae84e5963aae/rand_core-0.5.1/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C embed-bitcode=no --cfg 'feature="alloc"' --cfg 'feature="getrandom"' --cfg 'feature="std"' -C metadata=3fe48a2023567d7a -C extra-filename=-3fe48a2023567d7a --out-dir /home/user/zzz/newsboat-2.22.1/target/release/deps -L dependency=/home/user/zzz/newsboat-2.22.1/target/release/deps --extern getrandom=/home/user/zzz/newsboat-2.22.1/target/release/deps/libgetrandom-6ff5102b16a1985a.rmeta --cap-lints allow`
error[E0308]: mismatched types
    --> /home/user/.cargo/registry/src/github.com-1285ae84e5963aae/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
    --> /home/user/.cargo/registry/src/github.com-1285ae84e5963aae/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
    --> /home/user/.cargo/registry/src/github.com-1285ae84e5963aae/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`
    --> /home/user/.cargo/registry/src/github.com-1285ae84e5963aae/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
    --> /home/user/.cargo/registry/src/github.com-1285ae84e5963aae/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
    --> /home/user/.cargo/registry/src/github.com-1285ae84e5963aae/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
    --> /home/user/.cargo/registry/src/github.com-1285ae84e5963aae/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
    --> /home/user/.cargo/registry/src/github.com-1285ae84e5963aae/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`
    --> /home/user/.cargo/registry/src/github.com-1285ae84e5963aae/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
    --> /home/user/.cargo/registry/src/github.com-1285ae84e5963aae/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`
    --> /home/user/.cargo/registry/src/github.com-1285ae84e5963aae/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
    --> /home/user/.cargo/registry/src/github.com-1285ae84e5963aae/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`
    --> /home/user/.cargo/registry/src/github.com-1285ae84e5963aae/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
    --> /home/user/.cargo/registry/src/github.com-1285ae84e5963aae/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
    --> /home/user/.cargo/registry/src/github.com-1285ae84e5963aae/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`
    --> /home/user/.cargo/registry/src/github.com-1285ae84e5963aae/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
    --> /home/user/.cargo/registry/src/github.com-1285ae84e5963aae/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`
    --> /home/user/.cargo/registry/src/github.com-1285ae84e5963aae/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
    --> /home/user/.cargo/registry/src/github.com-1285ae84e5963aae/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`
    --> /home/user/.cargo/registry/src/github.com-1285ae84e5963aae/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
    --> /home/user/.cargo/registry/src/github.com-1285ae84e5963aae/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`
    --> /home/user/.cargo/registry/src/github.com-1285ae84e5963aae/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`

Caused by:
  process didn't exit successfully: `rustc --crate-name lexical_core --edition=2018 /home/user/.cargo/registry/src/github.com-1285ae84e5963aae/lexical-core-0.7.4/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C embed-bitcode=no --cfg 'feature="arrayvec"' --cfg 'feature="correct"' --cfg 'feature="default"' --cfg 'feature="ryu"' --cfg 'feature="static_assertions"' --cfg 'feature="std"' --cfg 'feature="table"' -C metadata=617a5463c7b0e3db -C extra-filename=-617a5463c7b0e3db --out-dir /home/user/zzz/newsboat-2.22.1/target/release/deps -L dependency=/home/user/zzz/newsboat-2.22.1/target/release/deps --extern arrayvec=/home/user/zzz/newsboat-2.22.1/target/release/deps/libarrayvec-af7e05f2f1778834.rmeta --extern bitflags=/home/user/zzz/newsboat-2.22.1/target/release/deps/libbitflags-0be668c34e4d7ff1.rmeta --extern cfg_if=/home/user/zzz/newsboat-2.22.1/target/release/deps/libcfg_if-a5574b329cfb54e6.rmeta --extern ryu=/home/user/zzz/newsboat-2.22.1/target/release/deps/libryu-8370e97f448acf1f.rmeta --extern static_assertions=/home/user/zzz/newsboat-2.22.1/target/release/deps/libstatic_assertions-9cc936ccc713e0fa.rmeta --cap-lints allow --cfg limb_width_32` (exit status: 1)
warning: build failed, waiting for other jobs to finish...
error: build failed
make: *** [Makefile:138: /home/user/zzz/newsboat-2.22.1/target/release/libnewsboat.a] Error 101
$ rustc --version
rustc 1.53.0-beta.12 (e7a67cc91 2021-06-12)

I tried to build it on Debian 10 (buster) with the rust installed by the script:

curl https://sh.rustup.rs -sSf | sh

What do I miss?

Regards, Piotr

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 21 (11 by maintainers)

Most upvoted comments

Relevant issue: https://github.com/Alexhuszagh/rust-lexical/issues/55. Relevant PR: https://github.com/newsboat/newsboat/pull/1472.

This can probably be solved (or worked around) in different ways. Either of the following options seem to work:

  • Update lexical-core to version >= 0.7.5 (e.g. cargo update -p lexical-core)
  • Build a newer version of Newsboat. (newsboat r2.23 specifies a newer (fixed) version of lexical-core in the Cargo.lock file)
  • Roll back to an older version of Rust (e.g. rustup toolchain install 1.52.0 && rustup default 1.52.0)