Improve the "monomorphization backtrace" for const-eval errors #122486
Labels
A-const-eval
Area: Constant evaluation (MIR interpretation)
A-diagnostics
Area: Messages for errors, warnings, and lints
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
When a const fails to evaluate, if there are generics involved it can be crucial to know where and how the const got instantiated to understand the error. For this purpose
interpret::ErrorHandled
has theemit_note
function that marks the point in the code where an erroneous constant is encountered.However, this could be done better:
Fixing this will require refactoring a bit how this note is emitted; currently
emit_note
has no idea which constant it is that failed and it can't compare old and new error counts to determine if the error would be right "above".The text was updated successfully, but these errors were encountered: