diff --git a/tests/ui-fulldeps/internal-lints/diagnostics.rs b/tests/ui-fulldeps/internal-lints/diagnostics.rs index 5fcff74064a..442f9d72c3f 100644 --- a/tests/ui-fulldeps/internal-lints/diagnostics.rs +++ b/tests/ui-fulldeps/internal-lints/diagnostics.rs @@ -117,4 +117,11 @@ pub fn skipped_because_of_annotation<'a>(dcx: DiagCtxtHandle<'a>) { fn f(_x: impl Into, _y: impl Into) {} fn g() { f(crate::fluent_generated::no_crate_example, crate::fluent_generated::no_crate_example); + f("untranslatable diagnostic", crate::fluent_generated::no_crate_example); + //~^ ERROR diagnostics should be created using translatable messages + f(crate::fluent_generated::no_crate_example, "untranslatable diagnostic"); + //~^ ERROR diagnostics should be created using translatable messages + f("untranslatable diagnostic", "untranslatable diagnostic"); + //~^ ERROR diagnostics should be created using translatable messages + //~^^ 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 669324ce5d4..c23da981ea2 100644 --- a/tests/ui-fulldeps/internal-lints/diagnostics.stderr +++ b/tests/ui-fulldeps/internal-lints/diagnostics.stderr @@ -46,5 +46,31 @@ error: diagnostics should be created using translatable messages LL | let _diag = dcx.struct_err("untranslatable diagnostic"); | ^^^^^^^^^^ -error: aborting due to 6 previous errors +error: diagnostics should be created using translatable messages + --> $DIR/diagnostics.rs:120:5 + | +LL | f("untranslatable diagnostic", crate::fluent_generated::no_crate_example); + | ^ + +error: diagnostics should be created using translatable messages + --> $DIR/diagnostics.rs:122:5 + | +LL | f(crate::fluent_generated::no_crate_example, "untranslatable diagnostic"); + | ^ + +error: diagnostics should be created using translatable messages + --> $DIR/diagnostics.rs:124:5 + | +LL | f("untranslatable diagnostic", "untranslatable diagnostic"); + | ^ + +error: diagnostics should be created using translatable messages + --> $DIR/diagnostics.rs:124:5 + | +LL | f("untranslatable diagnostic", "untranslatable diagnostic"); + | ^ + | + = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` + +error: aborting due to 10 previous errors