I have been trying to write a const fn that computes the Sieve of Erastothenes at compile time. It works perfectly until the max size of the Sieve gets to 1e6.
In that case, I get the default message for “long-running-const-eval” (https://doc.rust-lang.org/rustc/lints/listing/deny-by-default.html#long-running-const-eval).
I have added #[allow(long-running-const-eval)] and it still gives me an error.
What can I do in this situation? Filling the seive should take only a few seconds but the compiler gives up too soon.
Luis Henrique Dantas is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.