diff options
| author | Jhonny Bill Mena <jhonnybillm@gmail.com> | 2022-09-18 11:46:16 -0400 |
|---|---|---|
| committer | Jhonny Bill Mena <jhonnybillm@gmail.com> | 2022-09-21 11:39:53 -0400 |
| commit | 191fac68266b73158ff048c83556ea91cbf977fd (patch) | |
| tree | 5e744529ae1f878b19d5991e43e44a6bc6098ed9 /src | |
| parent | 19b348fed44342d8addbbb5e8f67cda5dc8d9b95 (diff) | |
| download | rust-191fac68266b73158ff048c83556ea91cbf977fd.tar.gz rust-191fac68266b73158ff048c83556ea91cbf977fd.zip | |
UPDATE - rename AddSubdiagnostic trait to AddToDiagnostic
Diffstat (limited to 'src')
| -rw-r--r-- | src/test/ui-fulldeps/internal-lints/diagnostics.rs | 14 | ||||
| -rw-r--r-- | src/test/ui-fulldeps/internal-lints/diagnostics.stderr | 4 |
2 files changed, 9 insertions, 9 deletions
diff --git a/src/test/ui-fulldeps/internal-lints/diagnostics.rs b/src/test/ui-fulldeps/internal-lints/diagnostics.rs index 1ead987ec41..e95ab048db3 100644 --- a/src/test/ui-fulldeps/internal-lints/diagnostics.rs +++ b/src/test/ui-fulldeps/internal-lints/diagnostics.rs @@ -12,7 +12,7 @@ extern crate rustc_session; extern crate rustc_span; use rustc_errors::{ - AddSubdiagnostic, IntoDiagnostic, Diagnostic, DiagnosticBuilder, + AddToDiagnostic, IntoDiagnostic, Diagnostic, DiagnosticBuilder, ErrorGuaranteed, Handler, fluent }; use rustc_macros::{DiagnosticHandler, SessionSubdiagnostic}; @@ -49,18 +49,18 @@ impl<'a> IntoDiagnostic<'a, ErrorGuaranteed> for TranslatableInSessionDiagnostic } } -pub struct UntranslatableInAddSubdiagnostic; +pub struct UntranslatableInAddToDiagnostic; -impl AddSubdiagnostic for UntranslatableInAddSubdiagnostic { +impl AddToDiagnostic for UntranslatableInAddToDiagnostic { fn add_to_diagnostic(self, diag: &mut Diagnostic) { diag.note("untranslatable diagnostic"); //~^ ERROR diagnostics should be created using translatable messages } } -pub struct TranslatableInAddSubdiagnostic; +pub struct TranslatableInAddToDiagnostic; -impl AddSubdiagnostic for TranslatableInAddSubdiagnostic { +impl AddToDiagnostic for TranslatableInAddToDiagnostic { fn add_to_diagnostic(self, diag: &mut Diagnostic) { diag.note(fluent::typeck::note); } @@ -68,10 +68,10 @@ impl AddSubdiagnostic for TranslatableInAddSubdiagnostic { pub fn make_diagnostics<'a>(handler: &'a Handler) { let _diag = handler.struct_err(fluent::parser::expect_path); - //~^ ERROR diagnostics should only be created in `IntoDiagnostic`/`AddSubdiagnostic` impls + //~^ ERROR diagnostics should only be created in `IntoDiagnostic`/`AddToDiagnostic` impls let _diag = handler.struct_err("untranslatable diagnostic"); - //~^ ERROR diagnostics should only be created in `IntoDiagnostic`/`AddSubdiagnostic` impls + //~^ ERROR diagnostics should only be created in `IntoDiagnostic`/`AddToDiagnostic` impls //~^^ ERROR diagnostics should be created using translatable messages } diff --git a/src/test/ui-fulldeps/internal-lints/diagnostics.stderr b/src/test/ui-fulldeps/internal-lints/diagnostics.stderr index d5833cf3970..9219d09e9b4 100644 --- a/src/test/ui-fulldeps/internal-lints/diagnostics.stderr +++ b/src/test/ui-fulldeps/internal-lints/diagnostics.stderr @@ -16,7 +16,7 @@ error: diagnostics should be created using translatable messages LL | diag.note("untranslatable diagnostic"); | ^^^^ -error: diagnostics should only be created in `IntoDiagnostic`/`AddSubdiagnostic` impls +error: diagnostics should only be created in `IntoDiagnostic`/`AddToDiagnostic` impls --> $DIR/diagnostics.rs:70:25 | LL | let _diag = handler.struct_err(fluent::parser::expect_path); @@ -28,7 +28,7 @@ note: the lint level is defined here LL | #![deny(rustc::diagnostic_outside_of_impl)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error: diagnostics should only be created in `IntoDiagnostic`/`AddSubdiagnostic` impls +error: diagnostics should only be created in `IntoDiagnostic`/`AddToDiagnostic` impls --> $DIR/diagnostics.rs:73:25 | LL | let _diag = handler.struct_err("untranslatable diagnostic"); |
