From: Yuki OKUSHI Date: Fri, 22 Mar 2019 15:03:50 +0000 (+0900) Subject: Remove err_count X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;h=526b3558581187c87ca8ca533254c1cbb6275e7b;p=rust.git Remove err_count --- diff --git a/src/librustc_mir/const_eval.rs b/src/librustc_mir/const_eval.rs index 0cf6c4593e8..80076c6f035 100644 --- a/src/librustc_mir/const_eval.rs +++ b/src/librustc_mir/const_eval.rs @@ -645,13 +645,14 @@ pub fn const_eval_raw_provider<'a, 'tcx>( "could not evaluate static initializer"); // Ensure that if the above error was either `TooGeneric` or `Reported` // an error must be reported. - let errs = tcx.sess.track_errors(|| { - tcx.sess.err_count(); + let tracked_err = tcx.sess.track_errors(|| { + err.report_as_error(ecx.tcx, + "could not evaluate static initializer"); }); - match errs { + match tracked_err { Ok(_) => tcx.sess.delay_span_bug(err.span, &format!("static eval failure did not emit an error: {:#?}", - reported_err)), + tracked_err)), Err(_) => (), } reported_err