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

Compile issue: the destructor for this type cannot be evaluated in constant functions #1186

Closed
jimpo opened this issue Aug 13, 2023 · 3 comments · Fixed by #1220
Closed

Compile issue: the destructor for this type cannot be evaluated in constant functions #1186

jimpo opened this issue Aug 13, 2023 · 3 comments · Fixed by #1220

Comments

@jimpo
Copy link
Collaborator

jimpo commented Aug 13, 2023

I am attempting to run tests in the plonky2_evm package and receive a compilation error:

$ RUSTFLAGS="-C target-cpu=native" cargo +nightly test --release --package plonky2_evm
   Compiling plonky2_evm v0.1.1 (/home/jimpo/Code/github.com/mir-protocol/plonky2/evm)
error[E0493]: destructor of `[std::ops::RangeInclusive<u8>; N]` cannot be evaluated at compile-time
  --> evm/src/cpu/kernel/constants/exc_bitfields.rs:7:53
   |
7  | const fn u256_from_set_index_ranges<const N: usize>(ranges: [RangeInclusive<u8>; N]) -> U256 {
   |                                                     ^^^^^^ the destructor for this type cannot be evaluated in constant functions
...
29 | }
   | - value is dropped here

For more information about this error, try `rustc --explain E0493`.
error: could not compile `plonky2_evm` (lib) due to previous error
warning: build failed, waiting for other jobs to finish...
error: could not compile `plonky2_evm` (lib test) due to previous error

My rustc version is:

$ rustc +nightly --version
rustc 1.73.0-nightly (a6f8aa5a0 2023-08-11)
$ cargo +nightly --version
cargo 1.73.0-nightly (d78bbf4bd 2023-08-03)
@jimpo jimpo changed the title Compile issue: Compile issue: the destructor for this type cannot be evaluated in constant functions Aug 13, 2023
@Nashtare
Copy link
Collaborator

You'd need to use an anterior version of nightly as specified in the CI.
nightly-2023-07-01 works fine.

@Nashtare
Copy link
Collaborator

@jimpo Has this been resolved with my suggestion?

@jonathanpwang
Copy link

I confirm your suggestion works: #1195

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