2020-08-27 10:00:21 +00:00
|
|
|
error: `#[derive(SessionDiagnostic)]` can only be used on structs
|
2022-03-31 07:35:17 +00:00
|
|
|
--> $DIR/session-derive-errors.rs:37:1
|
2020-08-27 10:00:21 +00:00
|
|
|
|
|
2022-03-31 07:35:17 +00:00
|
|
|
LL | / #[error(code = "E0123", slug = "foo")]
|
2020-11-18 10:18:40 +00:00
|
|
|
LL | |
|
|
|
|
LL | | enum SessionDiagnosticOnEnum {
|
|
|
|
LL | | Foo,
|
|
|
|
LL | | Bar,
|
|
|
|
LL | | }
|
|
|
|
| |_^
|
2020-08-27 10:00:21 +00:00
|
|
|
|
2022-03-31 07:35:17 +00:00
|
|
|
error: `#[error = ...]` is not a valid `SessionDiagnostic` struct attribute
|
|
|
|
--> $DIR/session-derive-errors.rs:46:1
|
2020-08-27 10:00:21 +00:00
|
|
|
|
|
2022-03-31 07:35:17 +00:00
|
|
|
LL | #[error = "E0123"]
|
|
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: `#[nonsense(...)]` is not a valid `SessionDiagnostic` struct attribute
|
|
|
|
--> $DIR/session-derive-errors.rs:51:1
|
|
|
|
|
|
|
|
|
LL | #[nonsense(code = "E0123", slug = "foo")]
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: diagnostic kind not specified
|
|
|
|
--> $DIR/session-derive-errors.rs:51:1
|
|
|
|
|
|
|
|
|
LL | / #[nonsense(code = "E0123", slug = "foo")]
|
|
|
|
LL | |
|
|
|
|
LL | |
|
|
|
|
LL | |
|
|
|
|
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
|
|
|
|
|
|
|
|
|
LL | #[error("E0123")]
|
|
|
|
| ^^^^^^^
|
|
|
|
|
|
|
|
error: `slug` not specified
|
|
|
|
--> $DIR/session-derive-errors.rs:58:1
|
|
|
|
|
|
|
|
|
LL | / #[error("E0123")]
|
|
|
|
LL | |
|
|
|
|
LL | |
|
|
|
|
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
|
|
|
|
|
|
|
|
|
LL | #[error(nonsense, code = "E0123", slug = "foo")]
|
|
|
|
| ^^^^^^^^
|
|
|
|
|
|
|
|
error: `#[error(nonsense(...))]` is not a valid `SessionDiagnostic` struct attribute
|
|
|
|
--> $DIR/session-derive-errors.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
|
|
|
|
|
|
|
|
|
LL | #[error(nonsense = "...", code = "E0123", slug = "foo")]
|
|
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: `#[error(nonsense = ...)]` is not a valid `SessionDiagnostic` struct attribute
|
|
|
|
--> $DIR/session-derive-errors.rs:79:9
|
|
|
|
|
|
|
|
|
LL | #[error(nonsense = 4, code = "E0123", slug = "foo")]
|
|
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
= help: value must be a string
|
2020-08-27 10:00:21 +00:00
|
|
|
|
2022-03-30 09:04:03 +00:00
|
|
|
error: `#[suggestion = ...]` is not a valid `SessionDiagnostic` field attribute
|
2022-03-31 07:35:17 +00:00
|
|
|
--> $DIR/session-derive-errors.rs:86:5
|
2020-08-27 10:00:21 +00:00
|
|
|
|
|
|
|
|
LL | #[suggestion = "this is the wrong kind of attribute"]
|
2020-11-18 10:18:40 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2020-08-27 10:00:21 +00:00
|
|
|
|
|
|
|
error: `error` specified multiple times
|
2022-03-31 07:35:17 +00:00
|
|
|
--> $DIR/session-derive-errors.rs:93:1
|
|
|
|
|
|
|
|
|
LL | #[error(code = "E0456", slug = "bar")]
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
note: previously specified here
|
|
|
|
--> $DIR/session-derive-errors.rs:92:1
|
2020-08-27 10:00:21 +00:00
|
|
|
|
|
2022-03-31 07:35:17 +00:00
|
|
|
LL | #[error(code = "E0123", slug = "foo")]
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2020-08-27 10:00:21 +00:00
|
|
|
|
2022-03-31 07:35:17 +00:00
|
|
|
error: `warning` specified when `error` was already specified
|
|
|
|
--> $DIR/session-derive-errors.rs:98:1
|
2020-08-27 10:00:21 +00:00
|
|
|
|
|
2022-03-31 07:35:17 +00:00
|
|
|
LL | #[warning(code = "E0293", slug = "bar")]
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
note: previously specified here
|
|
|
|
--> $DIR/session-derive-errors.rs:97:1
|
|
|
|
|
|
|
|
|
LL | #[error(code = "E0123", slug = "foo")]
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: `code` specified multiple times
|
|
|
|
--> $DIR/session-derive-errors.rs:103:32
|
|
|
|
|
|
|
|
|
LL | #[error(code = "E0456", code = "E0457", slug = "bar")]
|
|
|
|
| ^^^^^^^
|
|
|
|
|
|
|
|
|
note: previously specified here
|
|
|
|
--> $DIR/session-derive-errors.rs:103:16
|
|
|
|
|
|
|
|
|
LL | #[error(code = "E0456", code = "E0457", slug = "bar")]
|
|
|
|
| ^^^^^^^
|
|
|
|
|
|
|
|
error: `slug` specified multiple times
|
|
|
|
--> $DIR/session-derive-errors.rs:107:46
|
|
|
|
|
|
|
|
|
LL | #[error(code = "E0456", slug = "foo", slug = "bar")]
|
|
|
|
| ^^^^^
|
|
|
|
|
|
|
|
|
note: previously specified here
|
|
|
|
--> $DIR/session-derive-errors.rs:107:32
|
|
|
|
|
|
|
|
|
LL | #[error(code = "E0456", slug = "foo", slug = "bar")]
|
|
|
|
| ^^^^^
|
|
|
|
|
|
|
|
error: diagnostic kind not specified
|
|
|
|
--> $DIR/session-derive-errors.rs:111:1
|
|
|
|
|
|
|
|
|
LL | struct KindNotProvided {}
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
= help: use the `#[error(...)]` attribute to create an error
|
|
|
|
|
|
|
|
error: `slug` not specified
|
|
|
|
--> $DIR/session-derive-errors.rs:114:1
|
|
|
|
|
|
|
|
|
LL | / #[error(code = "E0456")]
|
|
|
|
LL | | struct SlugNotProvided {}
|
|
|
|
| |_________________________^
|
|
|
|
|
|
|
|
|
= help: use the `#[error(slug = "...")]` attribute to set this diagnostic's slug
|
2020-08-27 10:00:21 +00:00
|
|
|
|
|
|
|
error: `code` not specified
|
2022-03-31 07:35:17 +00:00
|
|
|
--> $DIR/session-derive-errors.rs:118:1
|
|
|
|
|
|
|
|
|
LL | / #[error(slug = "foo")]
|
|
|
|
LL | | struct CodeNotProvided {}
|
|
|
|
| |_________________________^
|
2020-08-27 10:00:21 +00:00
|
|
|
|
|
2022-03-31 07:35:17 +00:00
|
|
|
= help: use the `#[error(code = "...")]` attribute to set this diagnostic's error code
|
|
|
|
|
2022-03-31 07:50:45 +00:00
|
|
|
error: the `#[primary_span]` attribute can only be applied to fields of type `Span`
|
2022-03-31 07:35:17 +00:00
|
|
|
--> $DIR/session-derive-errors.rs:124:5
|
|
|
|
|
|
2022-03-31 07:50:45 +00:00
|
|
|
LL | #[primary_span]
|
|
|
|
| ^^^^^^^^^^^^^^^
|
2022-03-31 07:35:17 +00:00
|
|
|
|
|
|
|
error: `#[nonsense]` is not a valid `SessionDiagnostic` field attribute
|
|
|
|
--> $DIR/session-derive-errors.rs:132:5
|
2020-08-27 10:00:21 +00:00
|
|
|
|
|
2022-03-31 07:35:17 +00:00
|
|
|
LL | #[nonsense]
|
|
|
|
| ^^^^^^^^^^^
|
2020-08-27 10:00:21 +00:00
|
|
|
|
2022-03-31 07:35:17 +00:00
|
|
|
error: the `#[label = ...]` attribute can only be applied to fields of type `Span`
|
|
|
|
--> $DIR/session-derive-errors.rs:149:5
|
2020-08-27 10:00:21 +00:00
|
|
|
|
|
2022-03-31 07:35:17 +00:00
|
|
|
LL | #[label = "this message is applied to a String field"]
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2020-08-27 10:00:21 +00:00
|
|
|
|
|
|
|
error: `name` doesn't refer to a field on this type
|
2022-03-31 07:35:17 +00:00
|
|
|
--> $DIR/session-derive-errors.rs:157:5
|
2020-08-27 10:00:21 +00:00
|
|
|
|
|
2022-03-31 07:35:17 +00:00
|
|
|
LL | #[label = "This error has a field, and references {name}"]
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2020-08-27 10:00:21 +00:00
|
|
|
|
|
|
|
error: invalid format string: expected `'}'` but string was terminated
|
2022-03-31 07:35:17 +00:00
|
|
|
--> $DIR/session-derive-errors.rs:163:20
|
2020-08-27 10:00:21 +00:00
|
|
|
|
|
2021-07-17 18:13:50 +00:00
|
|
|
LL | #[derive(SessionDiagnostic)]
|
|
|
|
| ----------------- in this derive macro expansion
|
2022-03-31 07:35:17 +00:00
|
|
|
LL | #[error(code = "E0123", slug = "foo")]
|
|
|
|
| - ^ expected `'}'` in format string
|
|
|
|
| |
|
|
|
|
| because of this opening brace
|
2020-08-27 10:00:21 +00:00
|
|
|
|
|
|
|
|
= note: if you intended to print `{`, you can escape it using `{{`
|
2021-02-13 19:52:25 +00:00
|
|
|
= note: this error originates in the derive macro `SessionDiagnostic` (in Nightly builds, run with -Z macro-backtrace for more info)
|
2020-08-27 10:00:21 +00:00
|
|
|
|
|
|
|
error: invalid format string: unmatched `}` found
|
2022-03-31 07:35:17 +00:00
|
|
|
--> $DIR/session-derive-errors.rs:173:20
|
2020-08-27 10:00:21 +00:00
|
|
|
|
|
2021-07-17 18:13:50 +00:00
|
|
|
LL | #[derive(SessionDiagnostic)]
|
|
|
|
| ----------------- in this derive macro expansion
|
2022-03-31 07:35:17 +00:00
|
|
|
LL | #[error(code = "E0123", slug = "foo")]
|
|
|
|
| ^ unmatched `}` in format string
|
2020-08-27 10:00:21 +00:00
|
|
|
|
|
|
|
|
= note: if you intended to print `}`, you can escape it using `}}`
|
2021-02-13 19:52:25 +00:00
|
|
|
= note: this error originates in the derive macro `SessionDiagnostic` (in Nightly builds, run with -Z macro-backtrace for more info)
|
2020-08-27 10:00:21 +00:00
|
|
|
|
2022-03-31 07:35:17 +00:00
|
|
|
error: the `#[label = ...]` attribute can only be applied to fields of type `Span`
|
|
|
|
--> $DIR/session-derive-errors.rs:192:5
|
2020-08-27 10:00:21 +00:00
|
|
|
|
|
|
|
|
LL | #[label = "See here"]
|
2020-11-18 10:18:40 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^
|
2020-08-27 10:00:21 +00:00
|
|
|
|
|
|
|
error: `nonsense` is not a valid key for `#[suggestion(...)]`
|
2022-03-31 07:35:17 +00:00
|
|
|
--> $DIR/session-derive-errors.rs:217:18
|
2020-08-27 10:00:21 +00:00
|
|
|
|
|
|
|
|
LL | #[suggestion(nonsense = "This is nonsense")]
|
2020-11-18 10:18:40 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2020-08-27 10:00:21 +00:00
|
|
|
|
|
|
|
error: `msg` is not a valid key for `#[suggestion(...)]`
|
2022-03-31 07:35:17 +00:00
|
|
|
--> $DIR/session-derive-errors.rs:225:18
|
2020-08-27 10:00:21 +00:00
|
|
|
|
|
|
|
|
LL | #[suggestion(msg = "This is a suggestion")]
|
2020-11-18 10:18:40 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2020-08-27 10:00:21 +00:00
|
|
|
|
|
|
|
error: missing suggestion message
|
2022-03-31 07:35:17 +00:00
|
|
|
--> $DIR/session-derive-errors.rs:233:7
|
2020-08-27 10:00:21 +00:00
|
|
|
|
|
|
|
|
LL | #[suggestion(code = "This is suggested code")]
|
2020-11-18 10:18:40 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2020-08-27 10:00:21 +00:00
|
|
|
|
|
2022-03-30 09:04:03 +00:00
|
|
|
= help: provide a suggestion message using `#[suggestion(message = "...")]`
|
2020-08-27 10:00:21 +00:00
|
|
|
|
|
|
|
error: wrong field type for suggestion
|
2022-03-31 07:35:17 +00:00
|
|
|
--> $DIR/session-derive-errors.rs:248:5
|
2020-08-27 10:00:21 +00:00
|
|
|
|
|
2020-11-18 10:18:40 +00:00
|
|
|
LL | / #[suggestion(message = "This is a message", code = "This is suggested code")]
|
|
|
|
LL | |
|
|
|
|
LL | | suggestion: Applicability,
|
|
|
|
| |_____________________________^
|
2020-08-27 10:00:21 +00:00
|
|
|
|
|
2022-03-30 09:04:03 +00:00
|
|
|
= help: `#[suggestion(...)]` should be applied to fields of type `Span` or `(Span, Applicability)`
|
2020-08-27 10:00:21 +00:00
|
|
|
|
2022-03-30 09:04:03 +00:00
|
|
|
error: type of field annotated with `#[suggestion(...)]` contains more than one `Span`
|
2022-03-31 07:35:17 +00:00
|
|
|
--> $DIR/session-derive-errors.rs:263:5
|
2020-08-27 10:00:21 +00:00
|
|
|
|
|
2020-11-18 10:18:40 +00:00
|
|
|
LL | / #[suggestion(message = "This is a message", code = "This is suggested code")]
|
|
|
|
LL | |
|
|
|
|
LL | | suggestion: (Span, Span, Applicability),
|
|
|
|
| |___________________________________________^
|
2020-08-27 10:00:21 +00:00
|
|
|
|
|
|
|
error: type of field annotated with `#[suggestion(...)]` contains more than one Applicability
|
2022-03-31 07:35:17 +00:00
|
|
|
--> $DIR/session-derive-errors.rs:271:5
|
2020-08-27 10:00:21 +00:00
|
|
|
|
|
2020-11-18 10:18:40 +00:00
|
|
|
LL | / #[suggestion(message = "This is a message", code = "This is suggested code")]
|
|
|
|
LL | |
|
|
|
|
LL | | suggestion: (Applicability, Applicability, Span),
|
|
|
|
| |____________________________________________________^
|
2020-08-27 10:00:21 +00:00
|
|
|
|
|
|
|
error: invalid annotation list `#[label(...)]`
|
2022-03-31 07:35:17 +00:00
|
|
|
--> $DIR/session-derive-errors.rs:279:7
|
2020-08-27 10:00:21 +00:00
|
|
|
|
|
|
|
|
LL | #[label("wrong kind of annotation for label")]
|
2020-11-18 10:18:40 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2020-08-27 10:00:21 +00:00
|
|
|
|
2022-03-31 07:35:17 +00:00
|
|
|
error: cannot find attribute `nonsense` in this scope
|
|
|
|
--> $DIR/session-derive-errors.rs:51:3
|
|
|
|
|
|
|
|
|
LL | #[nonsense(code = "E0123", slug = "foo")]
|
|
|
|
| ^^^^^^^^
|
|
|
|
|
|
|
|
error: cannot find attribute `nonsense` in this scope
|
|
|
|
--> $DIR/session-derive-errors.rs:132:7
|
|
|
|
|
|
|
|
|
LL | #[nonsense]
|
|
|
|
| ^^^^^^^^
|
|
|
|
|
|
|
|
error: aborting due to 34 previous errors
|
2020-08-27 10:00:21 +00:00
|
|
|
|