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

Latest nightly fix #1220

Merged
merged 2 commits into from
Sep 8, 2023
Merged

Latest nightly fix #1220

merged 2 commits into from
Sep 8, 2023

Conversation

BGluth
Copy link
Collaborator

@BGluth BGluth commented Sep 7, 2023

There's one compiler error that's preventing us from building on the latest nightly, and I managed to resolve it by making a paremeter into a reference. I tried a few other things before resorting to using a reference (like #![feature(const_precise_live_drops)]), but I couldn't get it to compile. I think using a reference here should have no performance changes (since it's still a const fn at the end of the day), but let me know if there's a better way to fix this error.

For reference, the error was this:

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

Resolves #1186.

@BGluth BGluth requested a review from nbgl September 7, 2023 19:39
@BGluth
Copy link
Collaborator Author

BGluth commented Sep 7, 2023

I don't know if we want to do this, but we could also update the CI to use the latest nightly (or keep it on 2023-06-30 if we want something that we know will keep working). There's also #1195, which if we want we might as well merge and update it to point to a more up to date nightly.

@npwardberkeley
Copy link
Contributor

That sounds good to me!! It'd be nice to be on the latest version everywhere, including in the CI. Regarding #1195, can we set the rust-toolchain to just nightly? Or does it always need to be a particular one that we'd need to keep updating?

@BGluth
Copy link
Collaborator Author

BGluth commented Sep 7, 2023

We can definitely just have it point to the latest nightly. It just might mean that CI will randomly fail (which maybe is a good thing anyways) and we'll have to fix it.

@npwardberkeley npwardberkeley merged commit 2f1ed95 into main Sep 8, 2023
2 checks passed
@BGluth BGluth deleted the latest_nightly_fix branch September 8, 2023 17:07
@BGluth BGluth mentioned this pull request Sep 8, 2023
@BGluth BGluth removed the request for review from nbgl September 8, 2023 18:29
@Nashtare Nashtare mentioned this pull request Sep 11, 2023
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 this pull request may close these issues.

Compile issue: the destructor for this type cannot be evaluated in constant functions
2 participants