]> git.lizzy.rs Git - rust.git/commitdiff
Remove err_count
authorYuki OKUSHI <huyuumi.dev@gmail.com>
Fri, 22 Mar 2019 15:03:50 +0000 (00:03 +0900)
committerYuki OKUSHI <huyuumi.dev@gmail.com>
Thu, 28 Mar 2019 19:32:36 +0000 (04:32 +0900)
src/librustc_mir/const_eval.rs

index 0cf6c4593e8ddae5c6abcbf5c0baeaacfddc0fd9..80076c6f03533e75f0c388a88a504b6f9c6363bd 100644 (file)
@@ -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