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:
parent
dc05a30996
commit
7bdb227567
7 changed files with 26 additions and 19 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue