about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2023-12-13 15:19:34 +1100
committerNicholas Nethercote <n.nethercote@gmail.com>2023-12-14 15:53:55 +1100
commit7bdb227567398bed342697ea1f76f2cb34c9a7c2 (patch)
treee57efb994348b27c868a929d8c9025cb59da7329 /compiler/rustc_codegen_llvm/src
parentdc05a30996987b9a1a78184a5dc173b19404f1ab (diff)
downloadrust-7bdb227567398bed342697ea1f76f2cb34c9a7c2.tar.gz
rust-7bdb227567398bed342697ea1f76f2cb34c9a7c2.zip
Avoid `struct_diagnostic` where possible.
It's necessary for `derive(Diagnostic)`, but is best avoided elsewhere
because there are clearer alternatives.

This required adding `Handler::struct_almost_fatal`.
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
-rw-r--r--compiler/rustc_codegen_llvm/src/errors.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/rustc_codegen_llvm/src/errors.rs b/compiler/rustc_codegen_llvm/src/errors.rs
index 57ea13ddcd6..e6e37a02335 100644
--- a/compiler/rustc_codegen_llvm/src/errors.rs
+++ b/compiler/rustc_codegen_llvm/src/errors.rs
@@ -107,7 +107,8 @@ impl IntoDiagnostic<'_, FatalError> for ParseTargetMachineConfig<'_> {
         let (message, _) = diag.styled_message().first().expect("`LlvmError` with no message");
         let message = handler.eagerly_translate_to_string(message.clone(), diag.args());
 
-        let mut diag = handler.struct_diagnostic(fluent::codegen_llvm_parse_target_machine_config);
+        let mut diag =
+            handler.struct_almost_fatal(fluent::codegen_llvm_parse_target_machine_config);
         diag.set_arg("error", message);
         diag
     }