@@ -1091,7 +1091,7 @@ impl Handler { |
|
|
1091 |
1091 |
|
1092 |
1092 |
#[rustc_lint_diagnostics] |
1093 |
1093 |
pub fn fatal(&self, msg: impl Into<DiagnosticMessage>) -> ! { |
1094 |
|
-self.inner.borrow_mut().fatal_no_raise(msg).raise() |
|
1094 |
+DiagnosticBuilder::<FatalError>::new(self, Fatal, msg).emit().raise() |
1095 |
1095 |
} |
1096 |
1096 |
|
1097 |
1097 |
#[rustc_lint_diagnostics] |
@@ -1181,10 +1181,10 @@ impl Handler { |
|
|
1181 |
1181 |
DiagnosticMessage::Str(warnings), |
1182 |
1182 |
)), |
1183 |
1183 |
(_, 0) => { |
1184 |
|
-let _ = inner.fatal_no_raise(errors); |
|
1184 |
+ inner.emit_diagnostic(&mut Diagnostic::new(Fatal, errors)); |
1185 |
1185 |
} |
1186 |
1186 |
(_, _) => { |
1187 |
|
-let _ = inner.fatal_no_raise(format!("{errors}; {warnings}")); |
|
1187 |
+ inner.emit_diagnostic(&mut Diagnostic::new(Fatal, format!("{errors}; {warnings}"))); |
1188 |
1188 |
} |
1189 |
1189 |
} |
1190 |
1190 |
|
@@ -1592,13 +1592,6 @@ impl HandlerInner { |
|
|
1592 |
1592 |
self.emit_diagnostic(&mut Diagnostic::new(FailureNote, msg)); |
1593 |
1593 |
} |
1594 |
1594 |
|
1595 |
|
-// Note: unlike `Handler::fatal`, this doesn't return `!`, because that is |
1596 |
|
-// inappropriate for some of its call sites. |
1597 |
|
-fn fatal_no_raise(&mut self, msg: impl Into<DiagnosticMessage>) -> FatalError { |
1598 |
|
-self.emit_diagnostic(&mut Diagnostic::new(Fatal, msg)); |
1599 |
|
-FatalError |
1600 |
|
-} |
1601 |
|
- |
1602 |
1595 |
fn flush_delayed( |
1603 |
1596 |
&mut self, |
1604 |
1597 |
bugs: impl IntoIterator<Item = DelayedDiagnostic>, |