]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_errors/src/lib.rs
/nightly/nightly-rustc
[rust.git] / compiler / rustc_errors / src / lib.rs
index 2abd20869aecf0e66341ada087654164f1973c32..2e8a4ef327ac4474751025d59cf8f2fd9c6a9b4d 100644 (file)
@@ -2,7 +2,7 @@
 //!
 //! This module contains the code for creating and emitting diagnostics.
 
-#![doc(html_root_url = "https://doc.rust-lang.org/nightly/")]
+#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
 #![feature(crate_visibility_modifier)]
 #![feature(backtrace)]
 #![feature(nll)]
@@ -973,16 +973,14 @@ fn bump_warn_count(&mut self) {
 
     fn panic_if_treat_err_as_bug(&self) {
         if self.treat_err_as_bug() {
-            let s = match (self.err_count(), self.flags.treat_err_as_bug.unwrap_or(0)) {
-                (0, _) => return,
-                (1, 1) => "aborting due to `-Z treat-err-as-bug=1`".to_string(),
-                (1, _) => return,
-                (count, as_bug) => format!(
+            match (self.err_count(), self.flags.treat_err_as_bug.unwrap_or(0)) {
+                (1, 1) => panic!("aborting due to `-Z treat-err-as-bug=1`"),
+                (0, _) | (1, _) => {}
+                (count, as_bug) => panic!(
                     "aborting after {} errors due to `-Z treat-err-as-bug={}`",
                     count, as_bug,
                 ),
-            };
-            panic!(s);
+            }
         }
     }
 }