Use track_errors
instead of hand-rolling such a check
#59215
Labels
A-const-eval
Area: Constant evaluation (MIR interpretation)
E-easy
Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
E-mentor
Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.
Const eval asserts that reporting an error for statics actually worked. This is not only done in a wrong way (checks for no error having happened in the entire compilation), it's also very fragile. We should instead use the
track_errors
method around thereport_as_error
call, and in casetrack_errors
returnsOk
, we need to do thedelay_span_bug
.The relevant code that needs to be changed can be found in
rust/src/librustc_mir/const_eval.rs
Lines 645 to 654 in 16e7e05
The text was updated successfully, but these errors were encountered: