Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fails to compile with minimal dependency versions (due to old lexical-core) #1298

Closed
lo48576 opened this issue Apr 9, 2021 · 5 comments · Fixed by #1299
Closed

Fails to compile with minimal dependency versions (due to old lexical-core) #1298

lo48576 opened this issue Apr 9, 2021 · 5 comments · Fixed by #1299

Comments

@lo48576
Copy link
Contributor

lo48576 commented Apr 9, 2021

TL;DR

lexical-core dependency should be bumped to ^0.7.5.

(Strictly, it is enough if ^0.7.5 OR ^0.6.4 can be specified, but it doesn't seem to be possible with the current Cargo.toml format.)

Prerequisites

  • Rust version : rustc 1.51.0 (2fd73fabe 2021-03-23)
  • nom version : 6.1.2 (released on 2021-02-15)
  • nom compilation features used: any combination with lexical enabled (e.g. default-features = false, features = ["lexical"])

Test case

While I'm not sure why, this problem cannot be reproduced by tests inside the nom repository.
In order to reproduce, you have to set up another tiny crate, which depends on nom.

# Cargo.toml
[package]
name = "nom-mindep"
version = "0.0.0"
edition = "2018"

[dependencies]
nom = { version = "6.1.2", default-features = false, features = ["lexical"] }

(Actually, lexical-core = "=0.6.2" or lexical-core = "=0.7.4" seem to cause the same problem.)

// lib.rs, empty.

Then, run cargo +nightly update -Z minimal-versions ; cargo check.
Note that cargo +nightly update -Z minimal-versions only regenerates Cargo.lock with old dependency verisons as possible, in contrast to cargo update (which regenerates Cargo.lock with new dependency verisons as possible).
Once the lock file is regenerated, cargo check or normal build can be done by stable rustc.

Compile error message (long)
$ cargo +nightly update -Z minimal-versions ; cargo check
    Updating crates.io index
    Checking lexical-core v0.6.0
error: unexpected end of macro invocation
   --> /home/lo48576/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.6.0/src/lib.rs:166:2
    |
166 | }}  // cfg_if
    |  ^ missing tokens in macro arguments

error: unexpected end of macro invocation
   --> /home/lo48576/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.6.0/src/lib.rs:183:2
    |
183 | }}  // cfg_if
    |  ^ missing tokens in macro arguments

error: unexpected end of macro invocation
   --> /home/lo48576/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.6.0/src/lib.rs:207:2
    |
207 | }}  // cfg_if
    |  ^ missing tokens in macro arguments

error: unexpected end of macro invocation
   --> /home/lo48576/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.6.0/src/util/cast.rs:366:2
    |
366 | }}  // cfg_if
    |  ^ missing tokens in macro arguments

error: unexpected end of macro invocation
   --> /home/lo48576/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.6.0/src/util/config.rs:408:2
    |
408 | }}  // cfg_if
    |  ^ missing tokens in macro arguments

error: unexpected end of macro invocation
  --> /home/lo48576/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.6.0/src/util/table.rs:35:2
   |
35 | }}  // cfg_if
   |  ^ missing tokens in macro arguments

error: unexpected end of macro invocation
  --> /home/lo48576/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.6.0/src/util/table.rs:73:2
   |
73 | }}  // cfg_if
   |  ^ missing tokens in macro arguments

error: unexpected end of macro invocation
    --> /home/lo48576/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.6.0/src/util/table.rs:3227:2
     |
3227 | }}   // cfg_if
     |  ^ missing tokens in macro arguments

error: unexpected end of macro invocation
  --> /home/lo48576/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.6.0/src/atof/algorithm/state.rs:12:2
   |
12 | }}  // cfg_if
   |  ^ missing tokens in macro arguments

error: unexpected end of macro invocation
  --> /home/lo48576/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.6.0/src/atof/algorithm/mod.rs:35:2
   |
35 | }}  // cfg_if
   |  ^ missing tokens in macro arguments

error: unexpected end of macro invocation
   --> /home/lo48576/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.6.0/src/itoa/decimal.rs:760:2
    |
760 | }} // cfg_if
    |  ^ missing tokens in macro arguments

error[E0432]: unresolved import `super::alias`
  --> /home/lo48576/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.6.0/src/atof/algorithm/correct.rs:10:12
   |
10 | use super::alias::*;
   |            ^^^^^ could not find `alias` in `super`

error[E0432]: unresolved import `super::bhcomp`
  --> /home/lo48576/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.6.0/src/atof/algorithm/correct.rs:11:5
   |
11 | use super::bhcomp;
   |     ^^^^^^^^^^^^^ no `bhcomp` in `atof::algorithm`

error[E0432]: unresolved import `super::cached`
  --> /home/lo48576/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.6.0/src/atof/algorithm/correct.rs:12:12
   |
12 | use super::cached::ModeratePathCache;
   |            ^^^^^^ could not find `cached` in `super`

error[E0432]: unresolved import `super::errors`
  --> /home/lo48576/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.6.0/src/atof/algorithm/correct.rs:13:12
   |
13 | use super::errors::FloatErrors;
   |            ^^^^^^ could not find `errors` in `super`

error[E0432]: unresolved import `super::exponent`
  --> /home/lo48576/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.6.0/src/atof/algorithm/correct.rs:14:12
   |
14 | use super::exponent::*;
   |            ^^^^^^^^ could not find `exponent` in `super`

error[E0432]: unresolved import `super::small_powers`
  --> /home/lo48576/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.6.0/src/atof/algorithm/correct.rs:16:12
   |
16 | use super::small_powers::get_small_powers_64;
   |            ^^^^^^^^^^^^ could not find `small_powers` in `super`

error[E0432]: unresolved import `ryu`
 --> /home/lo48576/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.6.0/src/ftoa/ryu.rs:3:5
  |
3 | use ryu::raw;
  |     ^^^ help: a similar path exists: `super::ryu`

error[E0425]: cannot find value `USIZE_FORMATTED_SIZE` in this scope
   --> /home/lo48576/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.6.0/src/util/num.rs:53:11
    |
53  |     usize USIZE_FORMATTED_SIZE USIZE_FORMATTED_SIZE_DECIMAL ;
    |           ^^^^^^^^^^^^^^^^^^^^ help: a constant with a similar name exists: `I16_FORMATTED_SIZE`
    |
   ::: /home/lo48576/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.6.0/src/util/config.rs:379:5
    |
379 |     pub(crate) const I16_FORMATTED_SIZE: usize = I16_FORMATTED_SIZE_DECIMAL;
    |     ------------------------------------------------------------------------ similarly named constant `I16_FORMATTED_SIZE` defined here

error[E0425]: cannot find value `USIZE_FORMATTED_SIZE_DECIMAL` in this scope
   --> /home/lo48576/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.6.0/src/util/num.rs:53:32
    |
53  |     usize USIZE_FORMATTED_SIZE USIZE_FORMATTED_SIZE_DECIMAL ;
    |                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: a constant with a similar name exists: `I16_FORMATTED_SIZE_DECIMAL`
    |
   ::: /home/lo48576/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.6.0/src/util/config.rs:344:1
    |
344 | pub(crate) const I16_FORMATTED_SIZE_DECIMAL: usize = 6;
    | ------------------------------------------------------- similarly named constant `I16_FORMATTED_SIZE_DECIMAL` defined here

error[E0425]: cannot find value `ISIZE_FORMATTED_SIZE` in this scope
   --> /home/lo48576/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.6.0/src/util/num.rs:58:11
    |
58  |     isize ISIZE_FORMATTED_SIZE ISIZE_FORMATTED_SIZE_DECIMAL ;
    |           ^^^^^^^^^^^^^^^^^^^^ help: a constant with a similar name exists: `I128_FORMATTED_SIZE`
    |
   ::: /home/lo48576/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.6.0/src/util/config.rs:388:22
    |
388 |     #[cfg(has_i128)] pub(crate) const I128_FORMATTED_SIZE: usize = I128_FORMATTED_SIZE_DECIMAL;
    |                      -------------------------------------------------------------------------- similarly named constant `I128_FORMATTED_SIZE` defined here

error[E0425]: cannot find value `ISIZE_FORMATTED_SIZE_DECIMAL` in this scope
   --> /home/lo48576/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.6.0/src/util/num.rs:58:32
    |
58  |     isize ISIZE_FORMATTED_SIZE ISIZE_FORMATTED_SIZE_DECIMAL ;
    |                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: a constant with a similar name exists: `I128_FORMATTED_SIZE_DECIMAL`
    |
   ::: /home/lo48576/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.6.0/src/util/config.rs:353:18
    |
353 | #[cfg(has_i128)] pub(crate) const I128_FORMATTED_SIZE_DECIMAL: usize = 40;
    |                  --------------------------------------------------------- similarly named constant `I128_FORMATTED_SIZE_DECIMAL` defined here

error[E0405]: cannot find trait `TablePower` in this scope
  --> /home/lo48576/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.6.0/src/util/pow.rs:17:63
   |
17 |     pub(crate) trait StablePowerImpl: Float + ExactExponent + TablePower {
   |                                                               ^^^^^^^^^^ help: a trait with a similar name exists: `StablePower`
...
28 | pub(crate) trait StablePower: private::StablePowerImpl {
   | ------------------------------------------------------ similarly named trait `StablePower` defined here

error[E0412]: cannot find type `SliceIter` in this scope
   --> /home/lo48576/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.6.0/src/atof/algorithm/state.rs:207:42
    |
207 |     pub(super) fn integer_iter(&self) -> SliceIter<u8> {
    |                                          ^^^^^^^^^ not found in this scope

error[E0412]: cannot find type `SliceIter` in this scope
   --> /home/lo48576/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.6.0/src/atof/algorithm/state.rs:225:43
    |
225 |     pub(super) fn fraction_iter(&self) -> SliceIter<u8> {
    |                                           ^^^^^^^^^ not found in this scope

error[E0412]: cannot find type `ChainedSliceIter` in this scope
   --> /home/lo48576/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.6.0/src/atof/algorithm/state.rs:245:43
    |
245 |     pub(super) fn mantissa_iter(&self) -> ChainedSliceIter<u8> {
    |                                           ^^^^^^^^^^^^^^^^ not found in this scope

error[E0425]: cannot find function `mantissa_exponent` in this scope
   --> /home/lo48576/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.6.0/src/atof/algorithm/state.rs:258:9
    |
258 |         mantissa_exponent(self.raw_exponent, self.fraction_len(), self.truncated_digits())
    |         ^^^^^^^^^^^^^^^^^ not found in this scope

error[E0425]: cannot find function `scientific_exponent` in this scope
   --> /home/lo48576/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.6.0/src/atof/algorithm/state.rs:264:9
    |
264 |         scientific_exponent(self.raw_exponent, self.integer_digits(), self.digits_start)
    |         ^^^^^^^^^^^^^^^^^^^ not found in this scope

error[E0405]: cannot find trait `FloatType` in this scope
  --> /home/lo48576/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.6.0/src/atof/algorithm/correct.rs:41:14
   |
41 |     where F: FloatType
   |              ^^^^^^^^^ not found in this scope

error[E0405]: cannot find trait `FloatType` in this scope
   --> /home/lo48576/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.6.0/src/atof/algorithm/correct.rs:268:14
    |
268 |     where F: FloatType
    |              ^^^^^^^^^ not found in this scope

error[E0405]: cannot find trait `FloatType` in this scope
   --> /home/lo48576/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.6.0/src/atof/algorithm/correct.rs:295:14
    |
295 |     where F: FloatType
    |              ^^^^^^^^^ not found in this scope

error[E0425]: cannot find function `mantissa_exponent` in this scope
   --> /home/lo48576/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.6.0/src/atof/algorithm/correct.rs:310:24
    |
310 |         let mant_exp = mantissa_exponent(state.exponent, state.fraction.len(), 0);
    |                        ^^^^^^^^^^^^^^^^^ not found in this scope

error[E0405]: cannot find trait `FloatType` in this scope
   --> /home/lo48576/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.6.0/src/atof/algorithm/correct.rs:410:14
    |
410 |     where F: FloatType
    |              ^^^^^^^^^ not found in this scope

error[E0425]: cannot find value `DIGIT_TO_BASE10_SQUARED` in this scope
   --> /home/lo48576/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.6.0/src/itoa/decimal.rs:129:23
    |
129 | const TABLE: &[u8] = &DIGIT_TO_BASE10_SQUARED;
    |                       ^^^^^^^^^^^^^^^^^^^^^^^ not found in this scope

error[E0425]: cannot find function `usizetoa` in this scope
   --> /home/lo48576/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.6.0/src/itoa/decimal.rs:786:22
    |
776 |                 $cb(self, buffer)
    |                 ----------------- help: try calling `usizetoa` as a method: `self.usizetoa(buffer)`
...
786 | decimal_impl!(usize, usizetoa);
    |                      ^^^^^^^^

error: aborting due to 35 previous errors

Some errors have detailed explanations: E0405, E0412, E0425, E0432.
For more information about an error, try `rustc --explain E0405`.
error: could not compile `lexical-core`

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

Cause

Currently, nom depends on lexical-core crate >= 0.6, < 0.8, but this is problematic.

https://github.com/Geal/nom/blob/d1aff18e3c6b03bf3a1b6ca2826417c48995f4c1/Cargo.toml#L62

This problem is fixed by lexical-core ^0.6.4 OR ^0.7.5, so nom should pull only these newer versions.
However, it seems that cargo does not allow such "OR" condition.
In order to avoid this problem (i.e. to stop allowing invalid (non-compilable) dependency to be accepted), nom should depend on lexical-core ^0.7.5.

@lo48576
Copy link
Contributor Author

lo48576 commented Apr 9, 2021

I'm not sure #1156 is related, but older lexical-core seems to have caused other difficulties...

@simonracz
Copy link

Here is a thread that explained to me what's wrong with lexical-core 0.7.4

rust-lang/rust#81654

@Geal
Copy link
Collaborator

Geal commented Jun 19, 2021

hello, I just tried with a separate crate like you said, and rust 1.51.0, and I do not see the issue, is it still appearing for you?

@lo48576
Copy link
Contributor Author

lo48576 commented Jun 19, 2021

Yes, it still happens (with rust 1.53.0 (53cb7b09b 2021-06-17)).

terminal log
$ uname -a
Linux marco 5.12.12-gentoo #1 SMP Sat Jun 19 04:50:25 JST 2021 x86_64 AMD Ryzen 7 3800X 8-Core Processor AuthenticAMD GNU/Linux
$ rustc --version
rustc 1.53.0 (53cb7b09b 2021-06-17)
$ cargo new --lib temp && cd temp
$ echo 'nom = { version = "6.1.2", default-features = false, features = ["lexical"] }' >>Cargo.toml
$ tail -3 Cargo.toml

[dependencies]
nom = { version = "6.1.2", default-features = false, features = ["lexical"] }
$ cargo +nightly update -Z minimal-versions
    Updating crates.io index
$ cargo check
   Compiling semver-parser v0.7.0
   Compiling ryu v1.0.0
   Compiling version_check v0.9.0
    Checking nodrop v0.1.12
    Checking static_assertions v0.3.3
    Checking cfg-if v0.1.0
    Checking memchr v2.0.0
    Checking arrayvec v0.4.8
   Compiling semver v0.6.0
   Compiling nom v6.1.2
   Compiling rustc_version v0.2.0
   Compiling lexical-core v0.6.0
error: unexpected end of macro invocation
   --> /home/lo48576/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.6.0/src/lib.rs:166:2
    |
166 | }}  // cfg_if
    |  ^ missing tokens in macro arguments

error: unexpected end of macro invocation
   --> /home/lo48576/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.6.0/src/lib.rs:183:2
    |
183 | }}  // cfg_if
    |  ^ missing tokens in macro arguments

error: unexpected end of macro invocation
   --> /home/lo48576/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.6.0/src/lib.rs:207:2
    |
207 | }}  // cfg_if
    |  ^ missing tokens in macro arguments

error: unexpected end of macro invocation
   --> /home/lo48576/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.6.0/src/util/cast.rs:366:2
    |
366 | }}  // cfg_if
    |  ^ missing tokens in macro arguments

error: unexpected end of macro invocation
   --> /home/lo48576/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.6.0/src/util/config.rs:408:2
    |
408 | }}  // cfg_if
    |  ^ missing tokens in macro arguments

error: unexpected end of macro invocation
  --> /home/lo48576/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.6.0/src/util/table.rs:35:2
   |
35 | }}  // cfg_if
   |  ^ missing tokens in macro arguments

error: unexpected end of macro invocation
  --> /home/lo48576/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.6.0/src/util/table.rs:73:2
   |
73 | }}  // cfg_if
   |  ^ missing tokens in macro arguments

error: unexpected end of macro invocation
    --> /home/lo48576/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.6.0/src/util/table.rs:3227:2
     |
3227 | }}   // cfg_if
     |  ^ missing tokens in macro arguments

error: unexpected end of macro invocation
  --> /home/lo48576/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.6.0/src/atof/algorithm/state.rs:12:2
   |
12 | }}  // cfg_if
   |  ^ missing tokens in macro arguments

error: unexpected end of macro invocation
  --> /home/lo48576/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.6.0/src/atof/algorithm/mod.rs:35:2
   |
35 | }}  // cfg_if
   |  ^ missing tokens in macro arguments

error: unexpected end of macro invocation
   --> /home/lo48576/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.6.0/src/itoa/decimal.rs:760:2
    |
760 | }} // cfg_if
    |  ^ missing tokens in macro arguments

error[E0432]: unresolved import `super::alias`
  --> /home/lo48576/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.6.0/src/atof/algorithm/correct.rs:10:12
   |
10 | use super::alias::*;
   |            ^^^^^ could not find `alias` in `super`

error[E0432]: unresolved import `super::bhcomp`
  --> /home/lo48576/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.6.0/src/atof/algorithm/correct.rs:11:5
   |
11 | use super::bhcomp;
   |     ^^^^^^^^^^^^^ no `bhcomp` in `atof::algorithm`

error[E0432]: unresolved import `super::cached`
  --> /home/lo48576/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.6.0/src/atof/algorithm/correct.rs:12:12
   |
12 | use super::cached::ModeratePathCache;
   |            ^^^^^^ could not find `cached` in `super`

error[E0432]: unresolved import `super::errors`
  --> /home/lo48576/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.6.0/src/atof/algorithm/correct.rs:13:12
   |
13 | use super::errors::FloatErrors;
   |            ^^^^^^ could not find `errors` in `super`

error[E0432]: unresolved import `super::exponent`
  --> /home/lo48576/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.6.0/src/atof/algorithm/correct.rs:14:12
   |
14 | use super::exponent::*;
   |            ^^^^^^^^ could not find `exponent` in `super`

error[E0432]: unresolved import `super::small_powers`
  --> /home/lo48576/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.6.0/src/atof/algorithm/correct.rs:16:12
   |
16 | use super::small_powers::get_small_powers_64;
   |            ^^^^^^^^^^^^ could not find `small_powers` in `super`

error[E0432]: unresolved import `ryu`
 --> /home/lo48576/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.6.0/src/ftoa/ryu.rs:3:5
  |
3 | use ryu::raw;
  |     ^^^ help: a similar path exists: `super::ryu`

error[E0425]: cannot find value `USIZE_FORMATTED_SIZE` in this scope
   --> /home/lo48576/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.6.0/src/util/num.rs:53:11
    |
53  |     usize USIZE_FORMATTED_SIZE USIZE_FORMATTED_SIZE_DECIMAL ;
    |           ^^^^^^^^^^^^^^^^^^^^ help: a constant with a similar name exists: `I16_FORMATTED_SIZE`
    |
   ::: /home/lo48576/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.6.0/src/util/config.rs:379:5
    |
379 |     pub(crate) const I16_FORMATTED_SIZE: usize = I16_FORMATTED_SIZE_DECIMAL;
    |     ------------------------------------------------------------------------ similarly named constant `I16_FORMATTED_SIZE` defined here

error[E0425]: cannot find value `USIZE_FORMATTED_SIZE_DECIMAL` in this scope
   --> /home/lo48576/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.6.0/src/util/num.rs:53:32
    |
53  |     usize USIZE_FORMATTED_SIZE USIZE_FORMATTED_SIZE_DECIMAL ;
    |                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: a constant with a similar name exists: `I16_FORMATTED_SIZE_DECIMAL`
    |
   ::: /home/lo48576/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.6.0/src/util/config.rs:344:1
    |
344 | pub(crate) const I16_FORMATTED_SIZE_DECIMAL: usize = 6;
    | ------------------------------------------------------- similarly named constant `I16_FORMATTED_SIZE_DECIMAL` defined here

error[E0425]: cannot find value `ISIZE_FORMATTED_SIZE` in this scope
   --> /home/lo48576/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.6.0/src/util/num.rs:58:11
    |
58  |     isize ISIZE_FORMATTED_SIZE ISIZE_FORMATTED_SIZE_DECIMAL ;
    |           ^^^^^^^^^^^^^^^^^^^^ help: a constant with a similar name exists: `I128_FORMATTED_SIZE`
    |
   ::: /home/lo48576/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.6.0/src/util/config.rs:388:22
    |
388 |     #[cfg(has_i128)] pub(crate) const I128_FORMATTED_SIZE: usize = I128_FORMATTED_SIZE_DECIMAL;
    |                      -------------------------------------------------------------------------- similarly named constant `I128_FORMATTED_SIZE` defined here

error[E0425]: cannot find value `ISIZE_FORMATTED_SIZE_DECIMAL` in this scope
   --> /home/lo48576/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.6.0/src/util/num.rs:58:32
    |
58  |     isize ISIZE_FORMATTED_SIZE ISIZE_FORMATTED_SIZE_DECIMAL ;
    |                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: a constant with a similar name exists: `I128_FORMATTED_SIZE_DECIMAL`
    |
   ::: /home/lo48576/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.6.0/src/util/config.rs:353:18
    |
353 | #[cfg(has_i128)] pub(crate) const I128_FORMATTED_SIZE_DECIMAL: usize = 40;
    |                  --------------------------------------------------------- similarly named constant `I128_FORMATTED_SIZE_DECIMAL` defined here

error[E0405]: cannot find trait `TablePower` in this scope
  --> /home/lo48576/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.6.0/src/util/pow.rs:17:63
   |
17 |     pub(crate) trait StablePowerImpl: Float + ExactExponent + TablePower {
   |                                                               ^^^^^^^^^^ help: a trait with a similar name exists: `StablePower`
...
28 | pub(crate) trait StablePower: private::StablePowerImpl {
   | ------------------------------------------------------ similarly named trait `StablePower` defined here

error[E0412]: cannot find type `SliceIter` in this scope
   --> /home/lo48576/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.6.0/src/atof/algorithm/state.rs:207:42
    |
207 |     pub(super) fn integer_iter(&self) -> SliceIter<u8> {
    |                                          ^^^^^^^^^ not found in this scope

error[E0412]: cannot find type `SliceIter` in this scope
   --> /home/lo48576/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.6.0/src/atof/algorithm/state.rs:225:43
    |
225 |     pub(super) fn fraction_iter(&self) -> SliceIter<u8> {
    |                                           ^^^^^^^^^ not found in this scope

error[E0412]: cannot find type `ChainedSliceIter` in this scope
   --> /home/lo48576/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.6.0/src/atof/algorithm/state.rs:245:43
    |
245 |     pub(super) fn mantissa_iter(&self) -> ChainedSliceIter<u8> {
    |                                           ^^^^^^^^^^^^^^^^ not found in this scope

error[E0425]: cannot find function `mantissa_exponent` in this scope
   --> /home/lo48576/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.6.0/src/atof/algorithm/state.rs:258:9
    |
258 |         mantissa_exponent(self.raw_exponent, self.fraction_len(), self.truncated_digits())
    |         ^^^^^^^^^^^^^^^^^ not found in this scope

error[E0425]: cannot find function `scientific_exponent` in this scope
   --> /home/lo48576/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.6.0/src/atof/algorithm/state.rs:264:9
    |
264 |         scientific_exponent(self.raw_exponent, self.integer_digits(), self.digits_start)
    |         ^^^^^^^^^^^^^^^^^^^ not found in this scope

error[E0405]: cannot find trait `FloatType` in this scope
  --> /home/lo48576/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.6.0/src/atof/algorithm/correct.rs:41:14
   |
41 |     where F: FloatType
   |              ^^^^^^^^^ not found in this scope

error[E0405]: cannot find trait `FloatType` in this scope
   --> /home/lo48576/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.6.0/src/atof/algorithm/correct.rs:268:14
    |
268 |     where F: FloatType
    |              ^^^^^^^^^ not found in this scope

error[E0405]: cannot find trait `FloatType` in this scope
   --> /home/lo48576/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.6.0/src/atof/algorithm/correct.rs:295:14
    |
295 |     where F: FloatType
    |              ^^^^^^^^^ not found in this scope

error[E0425]: cannot find function `mantissa_exponent` in this scope
   --> /home/lo48576/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.6.0/src/atof/algorithm/correct.rs:310:24
    |
310 |         let mant_exp = mantissa_exponent(state.exponent, state.fraction.len(), 0);
    |                        ^^^^^^^^^^^^^^^^^ not found in this scope

error[E0405]: cannot find trait `FloatType` in this scope
   --> /home/lo48576/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.6.0/src/atof/algorithm/correct.rs:410:14
    |
410 |     where F: FloatType
    |              ^^^^^^^^^ not found in this scope

error[E0425]: cannot find value `DIGIT_TO_BASE10_SQUARED` in this scope
   --> /home/lo48576/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.6.0/src/itoa/decimal.rs:129:23
    |
129 | const TABLE: &[u8] = &DIGIT_TO_BASE10_SQUARED;
    |                       ^^^^^^^^^^^^^^^^^^^^^^^ not found in this scope

error[E0425]: cannot find function `usizetoa` in this scope
   --> /home/lo48576/.cargo/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.6.0/src/itoa/decimal.rs:786:22
    |
776 |                 $cb(self, buffer)
    |                 ----------------- help: try calling `usizetoa` as a method: `self.usizetoa(buffer)`
...
786 | decimal_impl!(usize, usizetoa);
    |                      ^^^^^^^^

error: aborting due to 35 previous errors

Some errors have detailed explanations: E0405, E0412, E0425, E0432.
For more information about an error, try `rustc --explain E0405`.
error: could not compile `lexical-core`

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

Don't forget to generate Cargo.lock with minimal deps by cargo +nightly update -Z minimal-versions.

Cargo.lock
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
version = 3

[[package]]
name = "arrayvec"
version = "0.4.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f405cc4c21cd8b784f6c8fc2adf9bc00f59558f0049b5ec21517f875963040cc"
dependencies = [
 "nodrop",
]

[[package]]
name = "cfg-if"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "de1e760d7b6535af4241fca8bd8adf68e2e7edacc6b29f5d399050c5e48cf88c"

[[package]]
name = "lexical-core"
version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8d85a493100782284591421ff88bdc866237dc61627017a9fe13cc340b8014e2"
dependencies = [
 "arrayvec",
 "cfg-if",
 "rustc_version",
 "ryu",
 "static_assertions",
]

[[package]]
name = "memchr"
version = "2.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e01e64d9017d18e7fc09d8e4fe0e28ff6931019e979fb8019319db7ca827f8a6"

[[package]]
name = "nodrop"
version = "0.1.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9a2228dca57108069a5262f2ed8bd2e82496d2e074a06d1ccc7ce1687b6ae0a2"

[[package]]
name = "nom"
version = "6.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e7413f999671bd4745a7b624bd370a569fb6bc574b23c83a3c5ed2e453f3d5e2"
dependencies = [
 "lexical-core",
 "memchr",
 "version_check",
]

[[package]]
name = "rustc_version"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1e114e275f7c9b5d50bb52b28f9aac1921209f02aa6077c8b255e21eefaf8ffa"
dependencies = [
 "semver",
]

[[package]]
name = "ryu"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c92464b447c0ee8c4fb3824ecc8383b81717b9f1e74ba2e72540aef7b9f82997"

[[package]]
name = "semver"
version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7a3186ec9e65071a2095434b1f5bb24838d4e8e130f584c790f6033c79943537"
dependencies = [
 "semver-parser",
]

[[package]]
name = "semver-parser"
version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3"

[[package]]
name = "static_assertions"
version = "0.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b4f8de36da215253eb5f24020bfaa0646613b48bf7ebe36cdfa37c3b3b33b241"

[[package]]
name = "temp"
version = "0.1.0"
dependencies = [
 "nom",
]

[[package]]
name = "version_check"
version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "45d3d553fd9413fffe7147a20171d640eda0ad4c070acd7d0c885a21bcd2e8b7"

@lo48576
Copy link
Contributor Author

lo48576 commented Jun 19, 2021

About -Z minimal-versions and Cargo.lock with minimal versions, see the announcement posted at URLO:
PSA: test with minimal versions, because your deps are most likely all broken - The Rust Programming Language Forum

Geal pushed a commit that referenced this issue Jun 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants