Skip to content

Commit 526b355

Browse files
committed
Remove err_count
1 parent 3ba7454 commit 526b355

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/librustc_mir/const_eval.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -645,13 +645,14 @@ pub fn const_eval_raw_provider<'a, 'tcx>(
645645
"could not evaluate static initializer");
646646
// Ensure that if the above error was either `TooGeneric` or `Reported`
647647
// an error must be reported.
648-
let errs = tcx.sess.track_errors(|| {
649-
tcx.sess.err_count();
648+
let tracked_err = tcx.sess.track_errors(|| {
649+
err.report_as_error(ecx.tcx,
650+
"could not evaluate static initializer");
650651
});
651-
match errs {
652+
match tracked_err {
652653
Ok(_) => tcx.sess.delay_span_bug(err.span,
653654
&format!("static eval failure did not emit an error: {:#?}",
654-
reported_err)),
655+
tracked_err)),
655656
Err(_) => (),
656657
}
657658
reported_err

0 commit comments

Comments
 (0)