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 7b5d983 commit 28cfa97Copy full SHA for 28cfa97
compiler/rustc_errors/src/lib.rs
@@ -973,16 +973,14 @@ impl HandlerInner {
973
974
fn panic_if_treat_err_as_bug(&self) {
975
if self.treat_err_as_bug() {
976
- let s = match (self.err_count(), self.flags.treat_err_as_bug.unwrap_or(0)) {
977
- (0, _) => return,
978
- (1, 1) => "aborting due to `-Z treat-err-as-bug=1`".to_string(),
979
- (1, _) => return,
980
- (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!(
981
"aborting after {} errors due to `-Z treat-err-as-bug={}`",
982
count, as_bug,
983
),
984
- };
985
- panic!(s);
+ }
986
}
987
988
0 commit comments