Skip to content

Commit 1e831e3

Browse files
committed
Fix up some ui-fulldeps tests.
1 parent f6aa418 commit 1e831e3

File tree

2 files changed

+22
-22
lines changed

2 files changed

+22
-22
lines changed

Diff for: tests/ui-fulldeps/internal-lints/diagnostics.rs

+10-10
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ extern crate rustc_session;
1313
extern crate rustc_span;
1414

1515
use rustc_errors::{
16-
AddToDiagnostic, Diagnostic, DiagnosticBuilder, DiagnosticMessage, ErrorGuaranteed, Handler,
16+
AddToDiagnostic, DiagCtxt, Diagnostic, DiagnosticBuilder, DiagnosticMessage, ErrorGuaranteed,
1717
IntoDiagnostic, SubdiagnosticMessage,
1818
};
1919
use rustc_macros::{Diagnostic, Subdiagnostic};
@@ -38,17 +38,17 @@ struct Note {
3838
pub struct UntranslatableInIntoDiagnostic;
3939

4040
impl<'a> IntoDiagnostic<'a, ErrorGuaranteed> for UntranslatableInIntoDiagnostic {
41-
fn into_diagnostic(self, handler: &'a Handler) -> DiagnosticBuilder<'a, ErrorGuaranteed> {
42-
handler.struct_err("untranslatable diagnostic")
41+
fn into_diagnostic(self, dcx: &'a DiagCtxt) -> DiagnosticBuilder<'a, ErrorGuaranteed> {
42+
dcx.struct_err("untranslatable diagnostic")
4343
//~^ ERROR diagnostics should be created using translatable messages
4444
}
4545
}
4646

4747
pub struct TranslatableInIntoDiagnostic;
4848

4949
impl<'a> IntoDiagnostic<'a, ErrorGuaranteed> for TranslatableInIntoDiagnostic {
50-
fn into_diagnostic(self, handler: &'a Handler) -> DiagnosticBuilder<'a, ErrorGuaranteed> {
51-
handler.struct_err(crate::fluent_generated::no_crate_example)
50+
fn into_diagnostic(self, dcx: &'a DiagCtxt) -> DiagnosticBuilder<'a, ErrorGuaranteed> {
51+
dcx.struct_err(crate::fluent_generated::no_crate_example)
5252
}
5353
}
5454

@@ -75,18 +75,18 @@ impl AddToDiagnostic for TranslatableInAddToDiagnostic {
7575
}
7676
}
7777

78-
pub fn make_diagnostics<'a>(handler: &'a Handler) {
79-
let _diag = handler.struct_err(crate::fluent_generated::no_crate_example);
78+
pub fn make_diagnostics<'a>(dcx: &'a DiagCtxt) {
79+
let _diag = dcx.struct_err(crate::fluent_generated::no_crate_example);
8080
//~^ ERROR diagnostics should only be created in `IntoDiagnostic`/`AddToDiagnostic` impls
8181

82-
let _diag = handler.struct_err("untranslatable diagnostic");
82+
let _diag = dcx.struct_err("untranslatable diagnostic");
8383
//~^ ERROR diagnostics should only be created in `IntoDiagnostic`/`AddToDiagnostic` impls
8484
//~^^ ERROR diagnostics should be created using translatable messages
8585
}
8686

8787
// Check that `rustc_lint_diagnostics`-annotated functions aren't themselves linted.
8888

8989
#[rustc_lint_diagnostics]
90-
pub fn skipped_because_of_annotation<'a>(handler: &'a Handler) {
91-
let _diag = handler.struct_err("untranslatable diagnostic"); // okay!
90+
pub fn skipped_because_of_annotation<'a>(dcx: &'a DiagCtxt) {
91+
let _diag = dcx.struct_err("untranslatable diagnostic"); // okay!
9292
}

Diff for: tests/ui-fulldeps/internal-lints/diagnostics.stderr

+12-12
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
error: diagnostics should be created using translatable messages
2-
--> $DIR/diagnostics.rs:42:17
2+
--> $DIR/diagnostics.rs:42:13
33
|
4-
LL | handler.struct_err("untranslatable diagnostic")
5-
| ^^^^^^^^^^
4+
LL | dcx.struct_err("untranslatable diagnostic")
5+
| ^^^^^^^^^^
66
|
77
note: the lint level is defined here
88
--> $DIR/diagnostics.rs:6:9
@@ -17,10 +17,10 @@ LL | diag.note("untranslatable diagnostic");
1717
| ^^^^
1818

1919
error: diagnostics should only be created in `IntoDiagnostic`/`AddToDiagnostic` impls
20-
--> $DIR/diagnostics.rs:79:25
20+
--> $DIR/diagnostics.rs:79:21
2121
|
22-
LL | let _diag = handler.struct_err(crate::fluent_generated::no_crate_example);
23-
| ^^^^^^^^^^
22+
LL | let _diag = dcx.struct_err(crate::fluent_generated::no_crate_example);
23+
| ^^^^^^^^^^
2424
|
2525
note: the lint level is defined here
2626
--> $DIR/diagnostics.rs:7:9
@@ -29,16 +29,16 @@ LL | #![deny(rustc::diagnostic_outside_of_impl)]
2929
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3030

3131
error: diagnostics should only be created in `IntoDiagnostic`/`AddToDiagnostic` impls
32-
--> $DIR/diagnostics.rs:82:25
32+
--> $DIR/diagnostics.rs:82:21
3333
|
34-
LL | let _diag = handler.struct_err("untranslatable diagnostic");
35-
| ^^^^^^^^^^
34+
LL | let _diag = dcx.struct_err("untranslatable diagnostic");
35+
| ^^^^^^^^^^
3636

3737
error: diagnostics should be created using translatable messages
38-
--> $DIR/diagnostics.rs:82:25
38+
--> $DIR/diagnostics.rs:82:21
3939
|
40-
LL | let _diag = handler.struct_err("untranslatable diagnostic");
41-
| ^^^^^^^^^^
40+
LL | let _diag = dcx.struct_err("untranslatable diagnostic");
41+
| ^^^^^^^^^^
4242

4343
error: aborting due to 5 previous errors
4444

0 commit comments

Comments
 (0)