Add more test cases for untranslatable_diagnostic lint
This commit is contained in:
parent
8291d68d92
commit
10ef6661bc
@ -117,4 +117,11 @@ pub fn skipped_because_of_annotation<'a>(dcx: DiagCtxtHandle<'a>) {
|
||||
fn f(_x: impl Into<DiagMessage>, _y: impl Into<SubdiagMessage>) {}
|
||||
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
|
||||
}
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user