Weird build error just appeared

Yesterday I was building fine. Today, my code still builds in VSCode but on the command line I have the following:

  Compiling evmlib v0.1.9
error[E0080]: evaluation of constant value failed
  --> /home/mrh/.cargo/registry/src/index.crates.io-6f17d22bba15001f/hex-literal-0.4.1/src/lib.rs:17:24
   |
17 |             0..=127 => panic!("Encountered invalid ASCII character"),
   |                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the evaluated program panicked at 'Encountered invalid ASCII character', /home/mrh/.cargo/registry/src/index.crates.io-6f17d22bba15001f/hex-literal-0.4.1/src/lib.rs:17:24
   |
note: inside `hex_literal::next_hex_char`
  --> /home/mrh/.cargo/registry/src/index.crates.io-6f17d22bba15001f/hex-literal-0.4.1/src/lib.rs:17:24
   |
17 |             0..=127 => panic!("Encountered invalid ASCII character"),
   |                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside `hex_literal::next_byte`
  --> /home/mrh/.cargo/registry/src/index.crates.io-6f17d22bba15001f/hex-literal-0.4.1/src/lib.rs:30:30
   |
30 |     let (half2, pos) = match next_hex_char(string, pos) {
   |                              ^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside `alloy::alloy_primitives::hex_literal::len`
  --> /home/mrh/.cargo/registry/src/index.crates.io-6f17d22bba15001f/hex-literal-0.4.1/src/lib.rs:46:40
   |
46 |         while let Some((_, new_pos)) = next_byte(strings[i], pos) {
   |                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside `ARBITRUM_ONE_PAYMENT_TOKEN_ADDRESS::LEN`
  --> /home/mrh/.cargo/registry/src/index.crates.io-6f17d22bba15001f/evmlib-0.1.9/src/lib.rs:48:5
   |
48 |     address!("0xa78d8321B20c4Ef90eCd72f2588AA985A4BDb684");
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   = note: this error originates in the macro `$crate::panic::panic_2021` which comes from the expansion of the macro `address` (in Nightly builds, run with -Z macro-backtrace for more info)

note: erroneous constant encountered
  --> /home/mrh/.cargo/registry/src/index.crates.io-6f17d22bba15001f/evmlib-0.1.9/src/lib.rs:48:5
   |
48 |     address!("0xa78d8321B20c4Ef90eCd72f2588AA985A4BDb684");
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: this note originates in the macro `$crate::hex` which comes from the expansion of the macro `address` (in Nightly builds, run with -Z macro-backtrace for more info)

For more information about this error, try `rustc --explain E0080`.
error: could not compile `evmlib` (lib) due to 1 previous error

I’ve been using a local autonomi repo for a while, but yesterday switched to using stable from crates.io without problems.

I don’t believe this is to do with changes to my source code or Cargo.toml because I’ve tried reverting to the previous working commit and no change.

I also tried cargo cache -r all and no change.

I’ve tried reverting lots of things but can’t shift this error.

Any clues!

$ rustc --version
rustc 1.83.0 (90b35a623 2024-11-26)
$ cargo --version
cargo 1.83.0 (5ffbef321 2024-10-29)
5 Likes

Hmm, sorry, I don’t know, but you might want to consider rustup update?

Definitely didn’t see anything like this when building the release.

1 Like

Perhaps try

cargo clean
git clean -fd
cargo build

Similar to my problem:

Solved here:


Check out the Dev Forum

Thanks everyone. :muscle: