about summary refs log tree commit diff
path: root/compiler/rustc_macros
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_macros
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_macros')
-rw-r--r--compiler/rustc_macros/src/diagnostics/diagnostic.rs6
-rw-r--r--compiler/rustc_macros/src/diagnostics/error.rs2
-rw-r--r--compiler/rustc_macros/src/diagnostics/subdiagnostic.rs4
3 files changed, 6 insertions, 6 deletions
diff --git a/compiler/rustc_macros/src/diagnostics/diagnostic.rs b/compiler/rustc_macros/src/diagnostics/diagnostic.rs
index 027c97330b1..5659569c645 100644
--- a/compiler/rustc_macros/src/diagnostics/diagnostic.rs
+++ b/compiler/rustc_macros/src/diagnostics/diagnostic.rs
@@ -51,7 +51,7 @@ impl<'a> DiagnosticDerive<'a> {
                 Some(slug) => {
                     slugs.borrow_mut().push(slug.clone());
                     quote! {
-                        let mut diag = rustc_errors::DiagnosticBuilder::new(
+                        let mut diag = rustc_errors::Diag::new(
                             dcx,
                             level,
                             crate::fluent_generated::#slug
@@ -83,7 +83,7 @@ impl<'a> DiagnosticDerive<'a> {
                     self,
                     dcx: &'_sess rustc_errors::DiagCtxt,
                     level: rustc_errors::Level
-                ) -> rustc_errors::DiagnosticBuilder<'_sess, G> {
+                ) -> rustc_errors::Diag<'_sess, G> {
                     #implementation
                 }
             }
@@ -160,7 +160,7 @@ impl<'a> LintDiagnosticDerive<'a> {
                 #[track_caller]
                 fn decorate_lint<'__b>(
                     self,
-                    diag: &'__b mut rustc_errors::DiagnosticBuilder<'__a, ()>
+                    diag: &'__b mut rustc_errors::Diag<'__a, ()>
                 ) {
                     #implementation;
                 }
diff --git a/compiler/rustc_macros/src/diagnostics/error.rs b/compiler/rustc_macros/src/diagnostics/error.rs
index 84b18a62028..13138ee4ab7 100644
--- a/compiler/rustc_macros/src/diagnostics/error.rs
+++ b/compiler/rustc_macros/src/diagnostics/error.rs
@@ -14,7 +14,7 @@ impl DiagnosticDeriveError {
         match self {
             DiagnosticDeriveError::SynError(e) => e.to_compile_error(),
             DiagnosticDeriveError::ErrorHandled => {
-                // Return ! to avoid having to create a blank DiagnosticBuilder to return when an
+                // Return ! to avoid having to create a blank Diag to return when an
                 // error has already been emitted to the compiler.
                 quote! {
                     { unreachable!(); }
diff --git a/compiler/rustc_macros/src/diagnostics/subdiagnostic.rs b/compiler/rustc_macros/src/diagnostics/subdiagnostic.rs
index 323614c222f..6cbebcc7320 100644
--- a/compiler/rustc_macros/src/diagnostics/subdiagnostic.rs
+++ b/compiler/rustc_macros/src/diagnostics/subdiagnostic.rs
@@ -89,7 +89,7 @@ impl SubdiagnosticDeriveBuilder {
             gen impl rustc_errors::AddToDiagnostic for @Self {
                 fn add_to_diagnostic_with<__G, __F>(
                     self,
-                    #diag: &mut rustc_errors::DiagnosticBuilder<'_, __G>,
+                    #diag: &mut rustc_errors::Diag<'_, __G>,
                     #f: __F
                 ) where
                     __G: rustc_errors::EmissionGuarantee,
@@ -108,7 +108,7 @@ impl SubdiagnosticDeriveBuilder {
 /// only to be able to destructure and split `self.builder` and the `self.structure` up to avoid a
 /// double mut borrow later on.
 struct SubdiagnosticDeriveVariantBuilder<'parent, 'a> {
-    /// The identifier to use for the generated `DiagnosticBuilder` instance.
+    /// The identifier to use for the generated `Diag` instance.
     parent: &'parent SubdiagnosticDeriveBuilder,
 
     /// Info for the current variant (or the type if not an enum).