Skip to content

Commit 704a4c5

Browse files
committed
Update fulldeps UI tests to the new lint diagnostic API
1 parent 957c07f commit 704a4c5

File tree

3 files changed

+9
-10
lines changed

3 files changed

+9
-10
lines changed

tests/ui-fulldeps/internal-lints/diagnostics.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ extern crate rustc_span;
1515

1616
use rustc_errors::{
1717
Diag, DiagCtxt, DiagInner, DiagMessage, Diagnostic, EmissionGuarantee, Level, LintDiagnostic,
18-
SubdiagMessageOp, SubdiagMessage, Subdiagnostic,
18+
MultiSpan, SubdiagMessageOp, SubdiagMessage, Subdiagnostic,
1919
};
2020
use rustc_macros::{Diagnostic, Subdiagnostic};
2121
use rustc_span::Span;
@@ -89,6 +89,10 @@ impl<'a> LintDiagnostic<'a, ()> for UntranslatableInLintDiagnostic {
8989
fn msg(&self) -> DiagMessage {
9090
unreachable!();
9191
}
92+
93+
fn span(&self) -> Option<MultiSpan> {
94+
None
95+
}
9296
}
9397

9498
pub struct TranslatableInLintDiagnostic;
@@ -101,6 +105,10 @@ impl<'a> LintDiagnostic<'a, ()> for TranslatableInLintDiagnostic {
101105
fn msg(&self) -> DiagMessage {
102106
unreachable!();
103107
}
108+
109+
fn span(&self) -> Option<MultiSpan> {
110+
None
111+
}
104112
}
105113

106114
pub fn make_diagnostics<'a>(dcx: &'a DiagCtxt) {

tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -561,7 +561,6 @@ struct LintsGood {}
561561
#[diag(no_crate_example)]
562562
struct PrimarySpanOnLint {
563563
#[primary_span]
564-
//~^ ERROR `#[primary_span]` is not a valid attribute
565564
span: Span,
566565
}
567566

tests/ui-fulldeps/session-diagnostic/diagnostic-derive.stderr

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -322,14 +322,6 @@ error: only `no_span` is a valid nested attribute
322322
LL | #[label(no_crate_label, foo("..."))]
323323
| ^^^
324324

325-
error: `#[primary_span]` is not a valid attribute
326-
--> $DIR/diagnostic-derive.rs:563:5
327-
|
328-
LL | #[primary_span]
329-
| ^
330-
|
331-
= help: the `primary_span` field attribute is not valid for lint diagnostics
332-
333325
error: `#[error(...)]` is not a valid attribute
334326
--> $DIR/diagnostic-derive.rs:583:1
335327
|

0 commit comments

Comments
 (0)