-
-
Notifications
You must be signed in to change notification settings - Fork 15k
Compiler error doesn't show full query chain when evaluating const cycle #66332
Copy link
Copy link
Open
Labels
A-const-evalArea: Constant evaluation, covers all const contexts (static, const fn, ...)Area: Constant evaluation, covers all const contexts (static, const fn, ...)A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.T-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.
Description
Metadata
Metadata
Assignees
Labels
A-const-evalArea: Constant evaluation, covers all const contexts (static, const fn, ...)Area: Constant evaluation, covers all const contexts (static, const fn, ...)A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.T-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.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Consider the following code (both on stable 1.39.0 and nightly)
There's a cycle evaluating the constants
C -> A -> B -> A -> ...The
dbg!(i32::C)line is the offending code which causes this cycle to be evaluated.However, the emitted error message doesn't actually reference the usage
dbg!(i32::C)which caused the evaluation, as below:This error could probably be improved by having an additional
note:showing that the cycle was used when evaluatingdbg!(i32::C).cc @oli-obk