tests: move diagnostic derive test to directory

Move existing test for session diagnostic derive to a subdirectory.

Signed-off-by: David Wood <david.wood@huawei.com>
This commit is contained in:
David Wood 2022-04-26 06:41:31 +01:00
parent 73fa217bc1
commit aa2abc9d12
2 changed files with 41 additions and 41 deletions

View File

@ -1,5 +1,5 @@
error: `#[derive(SessionDiagnostic)]` can only be used on structs
--> $DIR/session-derive-errors.rs:37:1
--> $DIR/diagnostic-derive.rs:37:1
|
LL | / #[error(code = "E0123", slug = "foo")]
LL | |
@ -10,19 +10,19 @@ LL | | }
| |_^
error: `#[error = ...]` is not a valid `SessionDiagnostic` struct attribute
--> $DIR/session-derive-errors.rs:46:1
--> $DIR/diagnostic-derive.rs:46:1
|
LL | #[error = "E0123"]
| ^^^^^^^^^^^^^^^^^^
error: `#[nonsense(...)]` is not a valid `SessionDiagnostic` struct attribute
--> $DIR/session-derive-errors.rs:51:1
--> $DIR/diagnostic-derive.rs:51:1
|
LL | #[nonsense(code = "E0123", slug = "foo")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: diagnostic kind not specified
--> $DIR/session-derive-errors.rs:51:1
--> $DIR/diagnostic-derive.rs:51:1
|
LL | / #[nonsense(code = "E0123", slug = "foo")]
LL | |
@ -34,13 +34,13 @@ LL | | struct InvalidStructAttr {}
= help: use the `#[error(...)]` attribute to create an error
error: `#[error("...")]` is not a valid `SessionDiagnostic` struct attribute
--> $DIR/session-derive-errors.rs:58:9
--> $DIR/diagnostic-derive.rs:58:9
|
LL | #[error("E0123")]
| ^^^^^^^
error: `slug` not specified
--> $DIR/session-derive-errors.rs:58:1
--> $DIR/diagnostic-derive.rs:58:1
|
LL | / #[error("E0123")]
LL | |
@ -51,25 +51,25 @@ LL | | struct InvalidLitNestedAttr {}
= help: use the `#[error(slug = "...")]` attribute to set this diagnostic's slug
error: `#[error(nonsense)]` is not a valid `SessionDiagnostic` struct attribute
--> $DIR/session-derive-errors.rs:64:9
--> $DIR/diagnostic-derive.rs:64:9
|
LL | #[error(nonsense, code = "E0123", slug = "foo")]
| ^^^^^^^^
error: `#[error(nonsense(...))]` is not a valid `SessionDiagnostic` struct attribute
--> $DIR/session-derive-errors.rs:69:9
--> $DIR/diagnostic-derive.rs:69:9
|
LL | #[error(nonsense("foo"), code = "E0123", slug = "foo")]
| ^^^^^^^^^^^^^^^
error: `#[error(nonsense = ...)]` is not a valid `SessionDiagnostic` struct attribute
--> $DIR/session-derive-errors.rs:74:9
--> $DIR/diagnostic-derive.rs:74:9
|
LL | #[error(nonsense = "...", code = "E0123", slug = "foo")]
| ^^^^^^^^^^^^^^^^
error: `#[error(nonsense = ...)]` is not a valid `SessionDiagnostic` struct attribute
--> $DIR/session-derive-errors.rs:79:9
--> $DIR/diagnostic-derive.rs:79:9
|
LL | #[error(nonsense = 4, code = "E0123", slug = "foo")]
| ^^^^^^^^^^^^
@ -77,61 +77,61 @@ LL | #[error(nonsense = 4, code = "E0123", slug = "foo")]
= help: value must be a string
error: `#[suggestion = ...]` is not a valid `SessionDiagnostic` field attribute
--> $DIR/session-derive-errors.rs:86:5
--> $DIR/diagnostic-derive.rs:86:5
|
LL | #[suggestion = "bar"]
| ^^^^^^^^^^^^^^^^^^^^^
error: `error` specified multiple times
--> $DIR/session-derive-errors.rs:93:1
--> $DIR/diagnostic-derive.rs:93:1
|
LL | #[error(code = "E0456", slug = "bar")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: previously specified here
--> $DIR/session-derive-errors.rs:92:1
--> $DIR/diagnostic-derive.rs:92:1
|
LL | #[error(code = "E0123", slug = "foo")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: `warning` specified when `error` was already specified
--> $DIR/session-derive-errors.rs:98:1
--> $DIR/diagnostic-derive.rs:98:1
|
LL | #[warning(code = "E0293", slug = "bar")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: previously specified here
--> $DIR/session-derive-errors.rs:97:1
--> $DIR/diagnostic-derive.rs:97:1
|
LL | #[error(code = "E0123", slug = "foo")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: `code` specified multiple times
--> $DIR/session-derive-errors.rs:103:32
--> $DIR/diagnostic-derive.rs:103:32
|
LL | #[error(code = "E0456", code = "E0457", slug = "bar")]
| ^^^^^^^
|
note: previously specified here
--> $DIR/session-derive-errors.rs:103:16
--> $DIR/diagnostic-derive.rs:103:16
|
LL | #[error(code = "E0456", code = "E0457", slug = "bar")]
| ^^^^^^^
error: `slug` specified multiple times
--> $DIR/session-derive-errors.rs:107:46
--> $DIR/diagnostic-derive.rs:107:46
|
LL | #[error(code = "E0456", slug = "foo", slug = "bar")]
| ^^^^^
|
note: previously specified here
--> $DIR/session-derive-errors.rs:107:32
--> $DIR/diagnostic-derive.rs:107:32
|
LL | #[error(code = "E0456", slug = "foo", slug = "bar")]
| ^^^^^
error: diagnostic kind not specified
--> $DIR/session-derive-errors.rs:111:1
--> $DIR/diagnostic-derive.rs:111:1
|
LL | struct KindNotProvided {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^
@ -139,7 +139,7 @@ LL | struct KindNotProvided {}
= help: use the `#[error(...)]` attribute to create an error
error: `slug` not specified
--> $DIR/session-derive-errors.rs:114:1
--> $DIR/diagnostic-derive.rs:114:1
|
LL | / #[error(code = "E0456")]
LL | | struct SlugNotProvided {}
@ -148,31 +148,31 @@ LL | | struct SlugNotProvided {}
= help: use the `#[error(slug = "...")]` attribute to set this diagnostic's slug
error: the `#[primary_span]` attribute can only be applied to fields of type `Span`
--> $DIR/session-derive-errors.rs:124:5
--> $DIR/diagnostic-derive.rs:124:5
|
LL | #[primary_span]
| ^^^^^^^^^^^^^^^
error: `#[nonsense]` is not a valid `SessionDiagnostic` field attribute
--> $DIR/session-derive-errors.rs:132:5
--> $DIR/diagnostic-derive.rs:132:5
|
LL | #[nonsense]
| ^^^^^^^^^^^
error: the `#[label = ...]` attribute can only be applied to fields of type `Span`
--> $DIR/session-derive-errors.rs:149:5
--> $DIR/diagnostic-derive.rs:149:5
|
LL | #[label = "bar"]
| ^^^^^^^^^^^^^^^^
error: `name` doesn't refer to a field on this type
--> $DIR/session-derive-errors.rs:157:42
--> $DIR/diagnostic-derive.rs:157:42
|
LL | #[suggestion(message = "bar", code = "{name}")]
| ^^^^^^^^
error: invalid format string: expected `'}'` but string was terminated
--> $DIR/session-derive-errors.rs:162:16
--> $DIR/diagnostic-derive.rs:162:16
|
LL | #[derive(SessionDiagnostic)]
| - ^ expected `'}'` in format string
@ -183,7 +183,7 @@ LL | #[derive(SessionDiagnostic)]
= note: this error originates in the derive macro `SessionDiagnostic` (in Nightly builds, run with -Z macro-backtrace for more info)
error: invalid format string: unmatched `}` found
--> $DIR/session-derive-errors.rs:172:15
--> $DIR/diagnostic-derive.rs:172:15
|
LL | #[derive(SessionDiagnostic)]
| ^ unmatched `}` in format string
@ -192,25 +192,25 @@ LL | #[derive(SessionDiagnostic)]
= note: this error originates in the derive macro `SessionDiagnostic` (in Nightly builds, run with -Z macro-backtrace for more info)
error: the `#[label = ...]` attribute can only be applied to fields of type `Span`
--> $DIR/session-derive-errors.rs:192:5
--> $DIR/diagnostic-derive.rs:192:5
|
LL | #[label = "bar"]
| ^^^^^^^^^^^^^^^^
error: `#[suggestion(nonsense = ...)]` is not a valid `SessionDiagnostic` field attribute
--> $DIR/session-derive-errors.rs:217:18
--> $DIR/diagnostic-derive.rs:217:18
|
LL | #[suggestion(nonsense = "bar")]
| ^^^^^^^^^^^^^^^^
error: `#[suggestion(msg = ...)]` is not a valid `SessionDiagnostic` field attribute
--> $DIR/session-derive-errors.rs:225:18
--> $DIR/diagnostic-derive.rs:225:18
|
LL | #[suggestion(msg = "bar")]
| ^^^^^^^^^^^
error: wrong field type for suggestion
--> $DIR/session-derive-errors.rs:247:5
--> $DIR/diagnostic-derive.rs:247:5
|
LL | / #[suggestion(message = "bar", code = "This is suggested code")]
LL | |
@ -220,7 +220,7 @@ LL | | suggestion: Applicability,
= help: `#[suggestion(...)]` should be applied to fields of type `Span` or `(Span, Applicability)`
error: type of field annotated with `#[suggestion(...)]` contains more than one `Span`
--> $DIR/session-derive-errors.rs:262:5
--> $DIR/diagnostic-derive.rs:262:5
|
LL | / #[suggestion(message = "bar", code = "This is suggested code")]
LL | |
@ -228,7 +228,7 @@ LL | | suggestion: (Span, Span, Applicability),
| |___________________________________________^
error: type of field annotated with `#[suggestion(...)]` contains more than one Applicability
--> $DIR/session-derive-errors.rs:270:5
--> $DIR/diagnostic-derive.rs:270:5
|
LL | / #[suggestion(message = "bar", code = "This is suggested code")]
LL | |
@ -236,49 +236,49 @@ LL | | suggestion: (Applicability, Applicability, Span),
| |____________________________________________________^
error: `#[label(...)]` is not a valid `SessionDiagnostic` field attribute
--> $DIR/session-derive-errors.rs:278:5
--> $DIR/diagnostic-derive.rs:278:5
|
LL | #[label("bar")]
| ^^^^^^^^^^^^^^^
error: `#[help]` must come after `#[error(..)]` or `#[warn(..)]`
--> $DIR/session-derive-errors.rs:399:1
--> $DIR/diagnostic-derive.rs:399:1
|
LL | #[help]
| ^^^^^^^
error: `#[help = ...]` must come after `#[error(..)]` or `#[warn(..)]`
--> $DIR/session-derive-errors.rs:407:1
--> $DIR/diagnostic-derive.rs:407:1
|
LL | #[help = "bar"]
| ^^^^^^^^^^^^^^^
error: `#[note]` must come after `#[error(..)]` or `#[warn(..)]`
--> $DIR/session-derive-errors.rs:415:1
--> $DIR/diagnostic-derive.rs:415:1
|
LL | #[note]
| ^^^^^^^
error: `#[note = ...]` must come after `#[error(..)]` or `#[warn(..)]`
--> $DIR/session-derive-errors.rs:423:1
--> $DIR/diagnostic-derive.rs:423:1
|
LL | #[note = "bar"]
| ^^^^^^^^^^^^^^^
error: cannot find attribute `nonsense` in this scope
--> $DIR/session-derive-errors.rs:51:3
--> $DIR/diagnostic-derive.rs:51:3
|
LL | #[nonsense(code = "E0123", slug = "foo")]
| ^^^^^^^^
error: cannot find attribute `nonsense` in this scope
--> $DIR/session-derive-errors.rs:132:7
--> $DIR/diagnostic-derive.rs:132:7
|
LL | #[nonsense]
| ^^^^^^^^
error[E0599]: no method named `into_diagnostic_arg` found for struct `Hello` in the current scope
--> $DIR/session-derive-errors.rs:322:10
--> $DIR/diagnostic-derive.rs:322:10
|
LL | struct Hello {}
| ------------ method `into_diagnostic_arg` not found for this