about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2024-03-06 14:00:16 +1100
committerNicholas Nethercote <n.nethercote@gmail.com>2024-03-11 10:04:49 +1100
commit541d7cc65c56402f31335e41075838c0da5fbe01 (patch)
tree4dcf1c44019f4bb235268ec7f45b38cc15617c43 /tests
parent7a294e998b66ea6d410a6840cba80347fc4764c2 (diff)
downloadrust-541d7cc65c56402f31335e41075838c0da5fbe01.tar.gz
rust-541d7cc65c56402f31335e41075838c0da5fbe01.zip
Rename `AddToDiagnostic` as `Subdiagnostic`.
To match `derive(Subdiagnostic)`.

Also rename `add_to_diagnostic{,_with}` as `add_to_diag{,_with}`.
Diffstat (limited to 'tests')
-rw-r--r--tests/ui-fulldeps/internal-lints/diagnostics.rs20
-rw-r--r--tests/ui-fulldeps/internal-lints/diagnostics.stderr4
2 files changed, 12 insertions, 12 deletions
diff --git a/tests/ui-fulldeps/internal-lints/diagnostics.rs b/tests/ui-fulldeps/internal-lints/diagnostics.rs
index e9c5a37bcd7..f9399cb81c8 100644
--- a/tests/ui-fulldeps/internal-lints/diagnostics.rs
+++ b/tests/ui-fulldeps/internal-lints/diagnostics.rs
@@ -14,8 +14,8 @@ extern crate rustc_session;
 extern crate rustc_span;
 
 use rustc_errors::{
-    AddToDiagnostic, DecorateLint, Diag, DiagCtxt, DiagInner, DiagMessage, EmissionGuarantee,
-    Diagnostic, Level, SubdiagMessageOp,
+    DecorateLint, Diag, DiagCtxt, DiagInner, DiagMessage, Diagnostic, EmissionGuarantee, Level,
+    SubdiagMessageOp, Subdiagnostic,
 };
 use rustc_macros::{Diagnostic, Subdiagnostic};
 use rustc_span::Span;
@@ -53,10 +53,10 @@ impl<'a, G: EmissionGuarantee> Diagnostic<'a, G> for TranslatableInDiagnostic {
     }
 }
 
-pub struct UntranslatableInAddToDiagnostic;
+pub struct UntranslatableInAddtoDiag;
 
-impl AddToDiagnostic for UntranslatableInAddToDiagnostic {
-    fn add_to_diagnostic_with<G: EmissionGuarantee, F: SubdiagMessageOp<G>>(
+impl Subdiagnostic for UntranslatableInAddtoDiag {
+    fn add_to_diag_with<G: EmissionGuarantee, F: SubdiagMessageOp<G>>(
         self,
         diag: &mut Diag<'_, G>,
         f: F,
@@ -66,10 +66,10 @@ impl AddToDiagnostic for UntranslatableInAddToDiagnostic {
     }
 }
 
-pub struct TranslatableInAddToDiagnostic;
+pub struct TranslatableInAddtoDiag;
 
-impl AddToDiagnostic for TranslatableInAddToDiagnostic {
-    fn add_to_diagnostic_with<G: EmissionGuarantee, F: SubdiagMessageOp<G>>(
+impl Subdiagnostic for TranslatableInAddtoDiag {
+    fn add_to_diag_with<G: EmissionGuarantee, F: SubdiagMessageOp<G>>(
         self,
         diag: &mut Diag<'_, G>,
         f: F,
@@ -105,10 +105,10 @@ impl<'a> DecorateLint<'a, ()> for TranslatableInDecorateLint {
 
 pub fn make_diagnostics<'a>(dcx: &'a DiagCtxt) {
     let _diag = dcx.struct_err(crate::fluent_generated::no_crate_example);
-    //~^ ERROR diagnostics should only be created in `Diagnostic`/`AddToDiagnostic` impls
+    //~^ ERROR diagnostics should only be created in `Diagnostic`/`Subdiagnostic` impls
 
     let _diag = dcx.struct_err("untranslatable diagnostic");
-    //~^ ERROR diagnostics should only be created in `Diagnostic`/`AddToDiagnostic` impls
+    //~^ ERROR diagnostics should only be created in `Diagnostic`/`Subdiagnostic` impls
     //~^^ ERROR diagnostics should be created using translatable messages
 }
 
diff --git a/tests/ui-fulldeps/internal-lints/diagnostics.stderr b/tests/ui-fulldeps/internal-lints/diagnostics.stderr
index ce6cc18e872..01184d7264b 100644
--- a/tests/ui-fulldeps/internal-lints/diagnostics.stderr
+++ b/tests/ui-fulldeps/internal-lints/diagnostics.stderr
@@ -22,7 +22,7 @@ error: diagnostics should be created using translatable messages
 LL |         diag.note("untranslatable diagnostic");
    |              ^^^^
 
-error: diagnostics should only be created in `Diagnostic`/`AddToDiagnostic` impls
+error: diagnostics should only be created in `Diagnostic`/`Subdiagnostic` impls
   --> $DIR/diagnostics.rs:107:21
    |
 LL |     let _diag = dcx.struct_err(crate::fluent_generated::no_crate_example);
@@ -34,7 +34,7 @@ note: the lint level is defined here
 LL | #![deny(rustc::diagnostic_outside_of_impl)]
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
-error: diagnostics should only be created in `Diagnostic`/`AddToDiagnostic` impls
+error: diagnostics should only be created in `Diagnostic`/`Subdiagnostic` impls
   --> $DIR/diagnostics.rs:110:21
    |
 LL |     let _diag = dcx.struct_err("untranslatable diagnostic");