untranslatable_diagnostic lint: point at the untranslated thing

and not the function/method call
This commit is contained in:
Pavel Grigorenko
2024-08-10 19:29:20 +03:00
parent 10ef6661bc
commit 3cc2a6fdcb
2 changed files with 28 additions and 28 deletions

View File

@@ -1,8 +1,8 @@
error: diagnostics should be created using translatable messages
--> $DIR/diagnostics.rs:43:9
--> $DIR/diagnostics.rs:43:31
|
LL | Diag::new(dcx, level, "untranslatable diagnostic")
| ^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: the lint level is defined here
--> $DIR/diagnostics.rs:7:9
@@ -11,16 +11,16 @@ LL | #![deny(rustc::untranslatable_diagnostic)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: diagnostics should be created using translatable messages
--> $DIR/diagnostics.rs:64:14
--> $DIR/diagnostics.rs:64:19
|
LL | diag.note("untranslatable diagnostic");
| ^^^^
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: diagnostics should be created using translatable messages
--> $DIR/diagnostics.rs:85:14
--> $DIR/diagnostics.rs:85:19
|
LL | diag.note("untranslatable diagnostic");
| ^^^^
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: diagnostics should only be created in `Diagnostic`/`Subdiagnostic`/`LintDiagnostic` impls
--> $DIR/diagnostics.rs:99:21
@@ -41,36 +41,34 @@ LL | let _diag = dcx.struct_err("untranslatable diagnostic");
| ^^^^^^^^^^
error: diagnostics should be created using translatable messages
--> $DIR/diagnostics.rs:102:21
--> $DIR/diagnostics.rs:102:32
|
LL | let _diag = dcx.struct_err("untranslatable diagnostic");
| ^^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: diagnostics should be created using translatable messages
--> $DIR/diagnostics.rs:120:5
--> $DIR/diagnostics.rs:120:7
|
LL | f("untranslatable diagnostic", crate::fluent_generated::no_crate_example);
| ^
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: diagnostics should be created using translatable messages
--> $DIR/diagnostics.rs:122:5
--> $DIR/diagnostics.rs:122:50
|
LL | f(crate::fluent_generated::no_crate_example, "untranslatable diagnostic");
| ^
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: diagnostics should be created using translatable messages
--> $DIR/diagnostics.rs:124:5
--> $DIR/diagnostics.rs:124:7
|
LL | f("untranslatable diagnostic", "untranslatable diagnostic");
| ^
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: diagnostics should be created using translatable messages
--> $DIR/diagnostics.rs:124:5
--> $DIR/diagnostics.rs:124:36
|
LL | f("untranslatable diagnostic", "untranslatable diagnostic");
| ^
|
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to 10 previous errors