about summary refs log tree commit diff
path: root/compiler/rustc_mir_transform/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_mir_transform/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_mir_transform/src')
-rw-r--r--compiler/rustc_mir_transform/src/errors.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_mir_transform/src/errors.rs b/compiler/rustc_mir_transform/src/errors.rs
index 2358661738a..dbf27ea60f8 100644
--- a/compiler/rustc_mir_transform/src/errors.rs
+++ b/compiler/rustc_mir_transform/src/errors.rs
@@ -65,7 +65,7 @@ pub(crate) struct RequiresUnsafe {
 impl<'sess> IntoDiagnostic<'sess> for RequiresUnsafe {
     #[track_caller]
     fn into_diagnostic(self, handler: &'sess Handler) -> DiagnosticBuilder<'sess, ErrorGuaranteed> {
-        let mut diag = handler.struct_diagnostic(fluent::mir_transform_requires_unsafe);
+        let mut diag = handler.struct_err(fluent::mir_transform_requires_unsafe);
         diag.code(rustc_errors::DiagnosticId::Error("E0133".to_string()));
         diag.set_span(self.span);
         diag.span_label(self.span, self.details.label());