Skip to content

Commit 7c36a05

Browse files
Adjust expected uitests results for the updated derive(Diagnostic) macro
1 parent 27503be commit 7c36a05

File tree

4 files changed

+120
-106
lines changed

4 files changed

+120
-106
lines changed

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

Lines changed: 23 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ struct Hello {}
4545
//~^ ERROR unsupported type attribute for diagnostic derive enum
4646
enum DiagnosticOnEnum {
4747
Foo,
48-
//~^ ERROR diagnostic slug not specified
48+
//~^ ERROR diagnostic message not specified
4949
Bar,
50-
//~^ ERROR diagnostic slug not specified
50+
//~^ ERROR diagnostic message not specified
5151
}
5252

5353
#[derive(Diagnostic)]
@@ -59,28 +59,28 @@ struct WrongStructAttrStyle {}
5959
#[derive(Diagnostic)]
6060
#[nonsense("this is an example message", code = E0123)]
6161
//~^ ERROR `#[nonsense(...)]` is not a valid attribute
62-
//~^^ ERROR diagnostic slug not specified
62+
//~^^ ERROR diagnostic message not specified
6363
//~^^^ ERROR cannot find attribute `nonsense` in this scope
6464
struct InvalidStructAttr {}
6565

6666
#[derive(Diagnostic)]
6767
#[diag(code = E0123)]
68-
//~^ ERROR diagnostic slug not specified
68+
//~^ ERROR diagnostic message not specified
6969
struct InvalidLitNestedAttr {}
7070

7171
#[derive(Diagnostic)]
7272
#[diag(nonsense("foo"), code = E0123, slug = "foo")]
73-
//~^ ERROR derive(Diagnostic): diagnostic slug not specified
73+
//~^ ERROR derive(Diagnostic): diagnostic message not specified
7474
struct InvalidNestedStructAttr1 {}
7575

7676
#[derive(Diagnostic)]
7777
#[diag(nonsense = "...", code = E0123, slug = "foo")]
78-
//~^ ERROR diagnostic slug not specified
78+
//~^ ERROR diagnostic message not specified
7979
struct InvalidNestedStructAttr2 {}
8080

8181
#[derive(Diagnostic)]
8282
#[diag(nonsense = 4, code = E0123, slug = "foo")]
83-
//~^ ERROR diagnostic slug not specified
83+
//~^ ERROR diagnostic message not specified
8484
struct InvalidNestedStructAttr3 {}
8585

8686
#[derive(Diagnostic)]
@@ -109,15 +109,15 @@ struct CodeSpecifiedTwice {}
109109

110110
#[derive(Diagnostic)]
111111
#[diag("this is an example message", no_crate::example, code = E0123)]
112-
//~^ ERROR diagnostic slug must be the first argument
112+
//~^ ERROR diagnostic message must be the first argument
113113
struct SlugSpecifiedTwice {}
114114

115115
#[derive(Diagnostic)]
116-
struct KindNotProvided {} //~ ERROR diagnostic slug not specified
116+
struct KindNotProvided {} //~ ERROR diagnostic message not specified
117117

118118
#[derive(Diagnostic)]
119119
#[diag(code = E0123)]
120-
//~^ ERROR diagnostic slug not specified
120+
//~^ ERROR diagnostic message not specified
121121
struct SlugNotProvided {}
122122

123123
#[derive(Diagnostic)]
@@ -467,7 +467,15 @@ struct BoolField {
467467
#[diag("this is an example message", code = E0123)]
468468
struct LabelWithTrailingPath {
469469
#[label("with a label", foo)]
470-
//~^ ERROR a diagnostic slug must be the first argument to the attribute
470+
//~^ ERROR derive(Diagnostic): no nested attribute expected here
471+
span: Span,
472+
}
473+
474+
#[derive(Diagnostic)]
475+
#[diag("this is an example message", code = E0123)]
476+
struct LabelWithTrailingMessage {
477+
#[label("with a label", "and another one?")]
478+
//~^ ERROR derive(Diagnostic): a diagnostic message must be the first argument to the attribute
471479
span: Span,
472480
}
473481

@@ -516,28 +524,28 @@ struct ErrorWithWarn {
516524
#[derive(Diagnostic)]
517525
#[error("this is an example message", code = E0123)]
518526
//~^ ERROR `#[error(...)]` is not a valid attribute
519-
//~| ERROR diagnostic slug not specified
527+
//~| ERROR diagnostic message not specified
520528
//~| ERROR cannot find attribute `error` in this scope
521529
struct ErrorAttribute {}
522530

523531
#[derive(Diagnostic)]
524532
#[warn_("this is an example message", code = E0123)]
525533
//~^ ERROR `#[warn_(...)]` is not a valid attribute
526-
//~| ERROR diagnostic slug not specified
534+
//~| ERROR diagnostic message not specified
527535
//~| ERROR cannot find attribute `warn_` in this scope
528536
struct WarnAttribute {}
529537

530538
#[derive(Diagnostic)]
531539
#[lint("this is an example message", code = E0123)]
532540
//~^ ERROR `#[lint(...)]` is not a valid attribute
533-
//~| ERROR diagnostic slug not specified
541+
//~| ERROR diagnostic message not specified
534542
//~| ERROR cannot find attribute `lint` in this scope
535543
struct LintAttributeOnSessionDiag {}
536544

537545
#[derive(LintDiagnostic)]
538546
#[lint("this is an example message", code = E0123)]
539547
//~^ ERROR `#[lint(...)]` is not a valid attribute
540-
//~| ERROR diagnostic slug not specified
548+
//~| ERROR diagnostic message not specified
541549
//~| ERROR cannot find attribute `lint` in this scope
542550
struct LintAttributeOnLintDiag {}
543551

0 commit comments

Comments
 (0)