about summary refs log tree commit diff
path: root/compiler/rustc_session/src/errors.rs
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_session/src/errors.rs
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_session/src/errors.rs')
-rw-r--r--compiler/rustc_session/src/errors.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_session/src/errors.rs b/compiler/rustc_session/src/errors.rs
index 7eed59709c8..aab7595ef6e 100644
--- a/compiler/rustc_session/src/errors.rs
+++ b/compiler/rustc_session/src/errors.rs
@@ -19,7 +19,7 @@ impl<'a> IntoDiagnostic<'a> for FeatureGateError {
         self,
         handler: &'a rustc_errors::Handler,
     ) -> rustc_errors::DiagnosticBuilder<'a, ErrorGuaranteed> {
-        let mut diag = handler.struct_diagnostic(self.explain);
+        let mut diag = handler.struct_err(self.explain);
         diag.set_span(self.span);
         diag.code(error_code!(E0658));
         diag