1
Fork 0

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`.
This commit is contained in:
Nicholas Nethercote 2023-12-13 15:19:34 +11:00
parent dc05a30996
commit 7bdb227567
7 changed files with 26 additions and 19 deletions

View file

@ -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
}