Repository navigation
[tracking issue] warnings on long running constant evaluations #49980
Description
Activity
- addedA-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-const-evalArea: Constant evaluation, covers all const contexts (static, const fn, ...)Area: Constant evaluation, covers all const contexts (static, const fn, ...)
on Apr 15, 2018 Seems like this will also require a small amount of refactoring? I don't think the evaluator where the warning is currently emitted knows the
NodeIdthat is needed when emitting the lint.We should be reporting the lint on the constant that is being evaluated, not the place that we are currently at, because that place might change between rustc versions
Note that just turning this into a lint is probably not enough. We need to also check whether the lint is
denyin the constant's scope. If it is, we need to abort the interpretation. Otherwise we'd just keep getting these lints as errors without ever stopping compilation.- addedT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFC
on Aug 27, 2018 Triage: I'm not aware of any changes here. I'm also not sure what to do to reproduce this issue, to be honest.
static FOO: () = loop {};gives (on beta)error[E0080]: could not evaluate static initializer --> src/lib.rs:1:18 | 1 | static FOO: () = loop {}; | ^^^^^^^ exceeded interpreter step limit (see `#[const_eval_limit]`)So I think we're good here
#49947 introduces a warning (removing the previous hard error).
This warning is currently unsilenceable and should probably become a lint. For simplicity (#49947 needs to be backported to beta) this has not been done.
"When" the warning appears is deterministic, but depends on MIR, so it might change between versions of rustc.