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 237bf32 commit 3ba7454Copy full SHA for 3ba7454
src/librustc_mir/const_eval.rs
@@ -645,10 +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
- if tcx.sess.err_count() == 0 {
649
- tcx.sess.delay_span_bug(err.span,
+ let errs = tcx.sess.track_errors(|| {
+ tcx.sess.err_count();
650
+ });
651
+ match errs {
652
+ Ok(_) => tcx.sess.delay_span_bug(err.span,
653
&format!("static eval failure did not emit an error: {:#?}",
- reported_err));
654
+ reported_err)),
655
+ Err(_) => (),
656
}
657
reported_err
658
} else if def_id.is_local() {
0 commit comments