We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3ba7454 commit 526b355Copy full SHA for 526b355
src/librustc_mir/const_eval.rs
@@ -645,13 +645,14 @@ pub fn const_eval_raw_provider<'a, 'tcx>(
645
"could not evaluate static initializer");
646
// Ensure that if the above error was either `TooGeneric` or `Reported`
647
// an error must be reported.
648
- let errs = tcx.sess.track_errors(|| {
649
- tcx.sess.err_count();
+ let tracked_err = tcx.sess.track_errors(|| {
+ err.report_as_error(ecx.tcx,
650
+ "could not evaluate static initializer");
651
});
- match errs {
652
+ match tracked_err {
653
Ok(_) => tcx.sess.delay_span_bug(err.span,
654
&format!("static eval failure did not emit an error: {:#?}",
- reported_err)),
655
+ tracked_err)),
656
Err(_) => (),
657
}
658
reported_err
0 commit comments