FIX - broken translatable diagnostics tests

This commit is contained in:
Jhonny Bill Mena 2022-09-05 12:05:14 -04:00
parent 1524b59444
commit 72f766ae71
2 changed files with 15 additions and 13 deletions

View File

@ -11,7 +11,9 @@ extern crate rustc_macros;
extern crate rustc_session;
extern crate rustc_span;
use rustc_errors::{AddSubdiagnostic, Diagnostic, DiagnosticBuilder, ErrorGuaranteed, Handler, fluent};
use rustc_errors::{
AddSubdiagnostic, Diagnostic, DiagnosticBuilder, ErrorGuaranteed, Handler, fluent
};
use rustc_macros::{SessionDiagnostic, SessionSubdiagnostic};
use rustc_session::SessionDiagnostic;
use rustc_span::Span;

View File

@ -1,8 +1,8 @@
error: diagnostics should be created using translatable messages
--> $DIR/diagnostics.rs:37:14
--> $DIR/diagnostics.rs:37:17
|
LL | sess.struct_err("untranslatable diagnostic")
| ^^^^^^^^^^
LL | handler.struct_err("untranslatable diagnostic")
| ^^^^^^^^^^
|
note: the lint level is defined here
--> $DIR/diagnostics.rs:6:9
@ -17,10 +17,10 @@ LL | diag.note("untranslatable diagnostic");
| ^^^^
error: diagnostics should only be created in `SessionDiagnostic`/`AddSubdiagnostic` impls
--> $DIR/diagnostics.rs:68:22
--> $DIR/diagnostics.rs:68:25
|
LL | let _diag = sess.struct_err(fluent::parser::expect_path);
| ^^^^^^^^^^
LL | let _diag = handler.struct_err(fluent::parser::expect_path);
| ^^^^^^^^^^
|
note: the lint level is defined here
--> $DIR/diagnostics.rs:7:9
@ -29,16 +29,16 @@ LL | #![deny(rustc::diagnostic_outside_of_impl)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: diagnostics should only be created in `SessionDiagnostic`/`AddSubdiagnostic` impls
--> $DIR/diagnostics.rs:71:22
--> $DIR/diagnostics.rs:71:25
|
LL | let _diag = sess.struct_err("untranslatable diagnostic");
| ^^^^^^^^^^
LL | let _diag = handler.struct_err("untranslatable diagnostic");
| ^^^^^^^^^^
error: diagnostics should be created using translatable messages
--> $DIR/diagnostics.rs:71:22
--> $DIR/diagnostics.rs:71:25
|
LL | let _diag = sess.struct_err("untranslatable diagnostic");
| ^^^^^^^^^^
LL | let _diag = handler.struct_err("untranslatable diagnostic");
| ^^^^^^^^^^
error: aborting due to 5 previous errors