about summary refs log tree commit diff
path: root/compiler/rustc_builtin_macros/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_builtin_macros/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_builtin_macros/src')
-rw-r--r--compiler/rustc_builtin_macros/src/errors.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_builtin_macros/src/errors.rs b/compiler/rustc_builtin_macros/src/errors.rs
index 0a3af2c2e13..3d02cd72e54 100644
--- a/compiler/rustc_builtin_macros/src/errors.rs
+++ b/compiler/rustc_builtin_macros/src/errors.rs
@@ -453,7 +453,7 @@ impl<'a> IntoDiagnostic<'a> for EnvNotDefinedWithUserMessage {
             rustc::untranslatable_diagnostic,
             reason = "cannot translate user-provided messages"
         )]
-        let mut diag = handler.struct_diagnostic(self.msg_from_user.to_string());
+        let mut diag = handler.struct_err(self.msg_from_user.to_string());
         diag.set_span(self.span);
         diag
     }
@@ -804,7 +804,7 @@ pub(crate) struct AsmClobberNoReg {
 impl<'a> IntoDiagnostic<'a> for AsmClobberNoReg {
     fn into_diagnostic(self, handler: &'a Handler) -> DiagnosticBuilder<'a, ErrorGuaranteed> {
         let mut diag =
-            handler.struct_diagnostic(crate::fluent_generated::builtin_macros_asm_clobber_no_reg);
+            handler.struct_err(crate::fluent_generated::builtin_macros_asm_clobber_no_reg);
         diag.set_span(self.spans.clone());
         // eager translation as `span_labels` takes `AsRef<str>`
         let lbl1 = handler.eagerly_translate_to_string(