2020-08-27 05:00:21 -05:00
|
|
|
error: `#[derive(SessionDiagnostic)]` can only be used on structs
|
2021-06-07 10:08:13 -05:00
|
|
|
--> $DIR/session-derive-errors.rs:34:1
|
2020-08-27 05:00:21 -05:00
|
|
|
|
|
2020-11-18 04:18:40 -06:00
|
|
|
LL | / #[error = "E0123"]
|
|
|
|
LL | |
|
|
|
|
LL | | enum SessionDiagnosticOnEnum {
|
|
|
|
LL | | Foo,
|
|
|
|
LL | | Bar,
|
|
|
|
LL | | }
|
|
|
|
| |_^
|
2020-08-27 05:00:21 -05:00
|
|
|
|
2022-03-30 04:04:03 -05:00
|
|
|
error: `#[label = ...]` is not a valid `SessionDiagnostic` struct attribute
|
2021-06-07 10:08:13 -05:00
|
|
|
--> $DIR/session-derive-errors.rs:43:1
|
2020-08-27 05:00:21 -05:00
|
|
|
|
|
|
|
|
LL | #[label = "This is in the wrong place"]
|
2020-11-18 04:18:40 -06:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2020-08-27 05:00:21 -05:00
|
|
|
|
2022-03-30 04:04:03 -05:00
|
|
|
error: `#[suggestion = ...]` is not a valid `SessionDiagnostic` field attribute
|
2021-06-07 10:08:13 -05:00
|
|
|
--> $DIR/session-derive-errors.rs:50:5
|
2020-08-27 05:00:21 -05:00
|
|
|
|
|
|
|
|
LL | #[suggestion = "this is the wrong kind of attribute"]
|
2020-11-18 04:18:40 -06:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2020-08-27 05:00:21 -05:00
|
|
|
|
|
|
|
error: `error` specified multiple times
|
2021-06-07 10:08:13 -05:00
|
|
|
--> $DIR/session-derive-errors.rs:58:11
|
2020-08-27 05:00:21 -05:00
|
|
|
|
|
|
|
|
LL | #[error = "E0456"]
|
|
|
|
| ^^^^^^^
|
|
|
|
|
|
|
|
error: `lint` specified when `error` was already specified
|
2021-06-07 10:08:13 -05:00
|
|
|
--> $DIR/session-derive-errors.rs:64:10
|
2020-08-27 05:00:21 -05:00
|
|
|
|
|
|
|
|
LL | #[lint = "some_useful_lint"]
|
|
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: `code` not specified
|
2021-06-07 10:08:13 -05:00
|
|
|
--> $DIR/session-derive-errors.rs:73:1
|
2020-08-27 05:00:21 -05:00
|
|
|
|
|
|
|
|
LL | struct ErrorCodeNotProvided {}
|
2020-11-18 04:18:40 -06:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2020-08-27 05:00:21 -05:00
|
|
|
|
|
2022-03-30 04:04:03 -05:00
|
|
|
= help: use the `#[code = "..."]` attribute to set this diagnostic's error code
|
2020-08-27 05:00:21 -05:00
|
|
|
|
2022-03-30 04:04:03 -05:00
|
|
|
error: the `#[message = "..."]` attribute can only be applied to fields of type `Span`
|
2021-06-07 10:08:13 -05:00
|
|
|
--> $DIR/session-derive-errors.rs:101:5
|
2020-08-27 05:00:21 -05:00
|
|
|
|
|
|
|
|
LL | #[message = "this message is applied to a String field"]
|
2020-11-18 04:18:40 -06:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2020-08-27 05:00:21 -05:00
|
|
|
|
|
|
|
error: `name` doesn't refer to a field on this type
|
2021-06-07 10:08:13 -05:00
|
|
|
--> $DIR/session-derive-errors.rs:108:1
|
2020-08-27 05:00:21 -05:00
|
|
|
|
|
|
|
|
LL | #[message = "This error has a field, and references {name}"]
|
2020-11-18 04:18:40 -06:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2020-08-27 05:00:21 -05:00
|
|
|
|
|
|
|
error: invalid format string: expected `'}'` but string was terminated
|
2021-06-07 10:08:13 -05:00
|
|
|
--> $DIR/session-derive-errors.rs:116:1
|
2020-08-27 05:00:21 -05:00
|
|
|
|
|
2021-07-17 13:13:50 -05:00
|
|
|
LL | #[derive(SessionDiagnostic)]
|
|
|
|
| ----------------- in this derive macro expansion
|
2020-08-27 05:00:21 -05:00
|
|
|
LL | #[error = "E0123"]
|
|
|
|
| - because of this opening brace
|
|
|
|
LL | #[message = "This is missing a closing brace: {name"]
|
|
|
|
| ^ expected `'}'` in format string
|
|
|
|
|
|
|
|
|
= note: if you intended to print `{`, you can escape it using `{{`
|
2021-02-13 13:52:25 -06:00
|
|
|
= note: this error originates in the derive macro `SessionDiagnostic` (in Nightly builds, run with -Z macro-backtrace for more info)
|
2020-08-27 05:00:21 -05:00
|
|
|
|
|
|
|
error: invalid format string: unmatched `}` found
|
2021-06-07 10:08:13 -05:00
|
|
|
--> $DIR/session-derive-errors.rs:125:1
|
2020-08-27 05:00:21 -05:00
|
|
|
|
|
2021-07-17 13:13:50 -05:00
|
|
|
LL | #[derive(SessionDiagnostic)]
|
|
|
|
| ----------------- in this derive macro expansion
|
|
|
|
LL | #[error = "E0123"]
|
2020-08-27 05:00:21 -05:00
|
|
|
LL | #[message = "This is missing an opening brace: name}"]
|
|
|
|
| ^ unmatched `}` in format string
|
|
|
|
|
|
|
|
|
= note: if you intended to print `}`, you can escape it using `}}`
|
2021-02-13 13:52:25 -06:00
|
|
|
= note: this error originates in the derive macro `SessionDiagnostic` (in Nightly builds, run with -Z macro-backtrace for more info)
|
2020-08-27 05:00:21 -05:00
|
|
|
|
2022-03-30 04:04:03 -05:00
|
|
|
error: The `#[label = ...]` attribute can only be applied to fields of type `Span`
|
2021-06-07 10:08:13 -05:00
|
|
|
--> $DIR/session-derive-errors.rs:144:5
|
2020-08-27 05:00:21 -05:00
|
|
|
|
|
|
|
|
LL | #[label = "See here"]
|
2020-11-18 04:18:40 -06:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^
|
2020-08-27 05:00:21 -05:00
|
|
|
|
|
|
|
error: `nonsense` is not a valid key for `#[suggestion(...)]`
|
2021-06-07 10:08:13 -05:00
|
|
|
--> $DIR/session-derive-errors.rs:169:18
|
2020-08-27 05:00:21 -05:00
|
|
|
|
|
|
|
|
LL | #[suggestion(nonsense = "This is nonsense")]
|
2020-11-18 04:18:40 -06:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2020-08-27 05:00:21 -05:00
|
|
|
|
|
|
|
error: `msg` is not a valid key for `#[suggestion(...)]`
|
2021-06-07 10:08:13 -05:00
|
|
|
--> $DIR/session-derive-errors.rs:177:18
|
2020-08-27 05:00:21 -05:00
|
|
|
|
|
|
|
|
LL | #[suggestion(msg = "This is a suggestion")]
|
2020-11-18 04:18:40 -06:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2020-08-27 05:00:21 -05:00
|
|
|
|
|
|
|
error: missing suggestion message
|
2021-06-07 10:08:13 -05:00
|
|
|
--> $DIR/session-derive-errors.rs:185:7
|
2020-08-27 05:00:21 -05:00
|
|
|
|
|
|
|
|
LL | #[suggestion(code = "This is suggested code")]
|
2020-11-18 04:18:40 -06:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2020-08-27 05:00:21 -05:00
|
|
|
|
|
2022-03-30 04:04:03 -05:00
|
|
|
= help: provide a suggestion message using `#[suggestion(message = "...")]`
|
2020-08-27 05:00:21 -05:00
|
|
|
|
|
|
|
error: wrong field type for suggestion
|
2021-06-07 10:08:13 -05:00
|
|
|
--> $DIR/session-derive-errors.rs:200:5
|
2020-08-27 05:00:21 -05:00
|
|
|
|
|
2020-11-18 04:18:40 -06:00
|
|
|
LL | / #[suggestion(message = "This is a message", code = "This is suggested code")]
|
|
|
|
LL | |
|
|
|
|
LL | | suggestion: Applicability,
|
|
|
|
| |_____________________________^
|
2020-08-27 05:00:21 -05:00
|
|
|
|
|
2022-03-30 04:04:03 -05:00
|
|
|
= help: `#[suggestion(...)]` should be applied to fields of type `Span` or `(Span, Applicability)`
|
2020-08-27 05:00:21 -05:00
|
|
|
|
2022-03-30 04:04:03 -05:00
|
|
|
error: type of field annotated with `#[suggestion(...)]` contains more than one `Span`
|
2021-06-07 10:08:13 -05:00
|
|
|
--> $DIR/session-derive-errors.rs:215:5
|
2020-08-27 05:00:21 -05:00
|
|
|
|
|
2020-11-18 04:18:40 -06:00
|
|
|
LL | / #[suggestion(message = "This is a message", code = "This is suggested code")]
|
|
|
|
LL | |
|
|
|
|
LL | | suggestion: (Span, Span, Applicability),
|
|
|
|
| |___________________________________________^
|
2020-08-27 05:00:21 -05:00
|
|
|
|
|
|
|
error: type of field annotated with `#[suggestion(...)]` contains more than one Applicability
|
2021-06-07 10:08:13 -05:00
|
|
|
--> $DIR/session-derive-errors.rs:223:5
|
2020-08-27 05:00:21 -05:00
|
|
|
|
|
2020-11-18 04:18:40 -06:00
|
|
|
LL | / #[suggestion(message = "This is a message", code = "This is suggested code")]
|
|
|
|
LL | |
|
|
|
|
LL | | suggestion: (Applicability, Applicability, Span),
|
|
|
|
| |____________________________________________________^
|
2020-08-27 05:00:21 -05:00
|
|
|
|
|
|
|
error: invalid annotation list `#[label(...)]`
|
2021-06-07 10:08:13 -05:00
|
|
|
--> $DIR/session-derive-errors.rs:231:7
|
2020-08-27 05:00:21 -05:00
|
|
|
|
|
|
|
|
LL | #[label("wrong kind of annotation for label")]
|
2020-11-18 04:18:40 -06:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2020-08-27 05:00:21 -05:00
|
|
|
|
|
|
|
error: aborting due to 18 previous errors
|
|
|
|
|