about summary refs log tree commit diff
path: root/compiler/rustc_mir_build/src/errors.rs
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2024-02-23 10:20:45 +1100
committerNicholas Nethercote <n.nethercote@gmail.com>2024-02-28 08:55:35 +1100
commit899cb40809a85eb9d89f6da3268713b83175360a (patch)
treee4c9a526f3eeb5d8563bfe254f1507648fddede2 /compiler/rustc_mir_build/src/errors.rs
parent4e1f9bd528aef7215bb3b446fcdf43368371da37 (diff)
downloadrust-899cb40809a85eb9d89f6da3268713b83175360a.tar.gz
rust-899cb40809a85eb9d89f6da3268713b83175360a.zip
Rename `DiagnosticBuilder` as `Diag`.
Much better!

Note that this involves renaming (and updating the value of)
`DIAGNOSTIC_BUILDER` in clippy.
Diffstat (limited to 'compiler/rustc_mir_build/src/errors.rs')
-rw-r--r--compiler/rustc_mir_build/src/errors.rs17
1 files changed, 7 insertions, 10 deletions
diff --git a/compiler/rustc_mir_build/src/errors.rs b/compiler/rustc_mir_build/src/errors.rs
index 101f1cb9f2f..95e69acbf23 100644
--- a/compiler/rustc_mir_build/src/errors.rs
+++ b/compiler/rustc_mir_build/src/errors.rs
@@ -1,8 +1,8 @@
 use crate::fluent_generated as fluent;
 use rustc_errors::DiagnosticArgValue;
 use rustc_errors::{
-    codes::*, AddToDiagnostic, Applicability, DiagCtxt, DiagnosticBuilder, EmissionGuarantee,
-    IntoDiagnostic, Level, MultiSpan, SubdiagnosticMessageOp,
+    codes::*, AddToDiagnostic, Applicability, Diag, DiagCtxt, EmissionGuarantee, IntoDiagnostic,
+    Level, MultiSpan, SubdiagnosticMessageOp,
 };
 use rustc_macros::{Diagnostic, LintDiagnostic, Subdiagnostic};
 use rustc_middle::ty::{self, Ty};
@@ -422,7 +422,7 @@ pub struct UnsafeNotInheritedLintNote {
 impl AddToDiagnostic for UnsafeNotInheritedLintNote {
     fn add_to_diagnostic_with<G: EmissionGuarantee, F: SubdiagnosticMessageOp<G>>(
         self,
-        diag: &mut DiagnosticBuilder<'_, G>,
+        diag: &mut Diag<'_, G>,
         _f: F,
     ) {
         diag.span_note(self.signature_span, fluent::mir_build_unsafe_fn_safe_body);
@@ -464,12 +464,9 @@ pub(crate) struct NonExhaustivePatternsTypeNotEmpty<'p, 'tcx, 'm> {
 impl<'a, G: EmissionGuarantee> IntoDiagnostic<'a, G>
     for NonExhaustivePatternsTypeNotEmpty<'_, '_, '_>
 {
-    fn into_diagnostic(self, dcx: &'a DiagCtxt, level: Level) -> DiagnosticBuilder<'_, G> {
-        let mut diag = DiagnosticBuilder::new(
-            dcx,
-            level,
-            fluent::mir_build_non_exhaustive_patterns_type_not_empty,
-        );
+    fn into_diagnostic(self, dcx: &'a DiagCtxt, level: Level) -> Diag<'_, G> {
+        let mut diag =
+            Diag::new(dcx, level, fluent::mir_build_non_exhaustive_patterns_type_not_empty);
         diag.span(self.span);
         diag.code(E0004);
         let peeled_ty = self.ty.peel_refs();
@@ -873,7 +870,7 @@ pub struct Variant {
 impl<'tcx> AddToDiagnostic for AdtDefinedHere<'tcx> {
     fn add_to_diagnostic_with<G: EmissionGuarantee, F: SubdiagnosticMessageOp<G>>(
         self,
-        diag: &mut DiagnosticBuilder<'_, G>,
+        diag: &mut Diag<'_, G>,
         _f: F,
     ) {
         diag.arg("ty", self.ty);