1
Fork 0

Rollup merge of #119171 - nnethercote:cleanup-errors-4, r=compiler-errors

Cleanup error handlers: round 4

More `rustc_errors` cleanups. A sequel to #118933.

r? `@compiler-errors`
This commit is contained in:
Michael Goulet 2023-12-22 21:41:03 -05:00 committed by GitHub
commit e0d7a72c46
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
84 changed files with 611 additions and 946 deletions

View file

@ -102,7 +102,7 @@ pub(crate) struct ParseTargetMachineConfig<'a>(pub LlvmError<'a>);
impl<G: EmissionGuarantee> IntoDiagnostic<'_, G> for ParseTargetMachineConfig<'_> {
fn into_diagnostic(self, dcx: &'_ DiagCtxt, level: Level) -> DiagnosticBuilder<'_, G> {
let diag: DiagnosticBuilder<'_, G> = self.0.into_diagnostic(dcx, level);
let (message, _) = diag.styled_message().first().expect("`LlvmError` with no message");
let (message, _) = diag.messages().first().expect("`LlvmError` with no message");
let message = dcx.eagerly_translate_to_string(message.clone(), diag.args());
let mut diag =