1 error: `#[derive(SessionDiagnostic)]` can only be used on structs
2 --> $DIR/session-derive-errors.rs:28:1
4 LL | / #[error = "E0123"]
6 LL | | enum SessionDiagnosticOnEnum {
12 error: `#[label = ...]` is not a valid SessionDiagnostic struct attribute
13 --> $DIR/session-derive-errors.rs:37:1
15 LL | #[label = "This is in the wrong place"]
16 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
18 error: `#[suggestion = ...]` is not a valid SessionDiagnostic field attribute
19 --> $DIR/session-derive-errors.rs:44:5
21 LL | #[suggestion = "this is the wrong kind of attribute"]
22 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
24 error: `error` specified multiple times
25 --> $DIR/session-derive-errors.rs:52:11
27 LL | #[error = "E0456"]
30 error: `lint` specified when `error` was already specified
31 --> $DIR/session-derive-errors.rs:58:10
33 LL | #[lint = "some_useful_lint"]
36 error: `code` not specified
37 --> $DIR/session-derive-errors.rs:67:1
39 LL | struct ErrorCodeNotProvided {}
40 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
42 = help: use the [code = "..."] attribute to set this diagnostic's error code
44 error: the `#[message = "..."]` attribute can only be applied to fields of type Span
45 --> $DIR/session-derive-errors.rs:95:5
47 LL | #[message = "this message is applied to a String field"]
48 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
50 error: `name` doesn't refer to a field on this type
51 --> $DIR/session-derive-errors.rs:102:1
53 LL | #[message = "This error has a field, and references {name}"]
54 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
56 error: invalid format string: expected `'}'` but string was terminated
57 --> $DIR/session-derive-errors.rs:110:1
59 LL | #[error = "E0123"]
60 | - because of this opening brace
61 LL | #[message = "This is missing a closing brace: {name"]
62 | ^ expected `'}'` in format string
64 = note: if you intended to print `{`, you can escape it using `{{`
65 = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
67 error: invalid format string: unmatched `}` found
68 --> $DIR/session-derive-errors.rs:119:1
70 LL | #[message = "This is missing an opening brace: name}"]
71 | ^ unmatched `}` in format string
73 = note: if you intended to print `}`, you can escape it using `}}`
74 = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
76 error: The `#[label = ...]` attribute can only be applied to fields of type Span
77 --> $DIR/session-derive-errors.rs:138:5
79 LL | #[label = "See here"]
80 | ^^^^^^^^^^^^^^^^^^^^^
82 error: `nonsense` is not a valid key for `#[suggestion(...)]`
83 --> $DIR/session-derive-errors.rs:163:18
85 LL | #[suggestion(nonsense = "This is nonsense")]
86 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
88 error: `msg` is not a valid key for `#[suggestion(...)]`
89 --> $DIR/session-derive-errors.rs:171:18
91 LL | #[suggestion(msg = "This is a suggestion")]
92 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
94 error: missing suggestion message
95 --> $DIR/session-derive-errors.rs:179:7
97 LL | #[suggestion(code = "This is suggested code")]
98 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
100 = help: provide a suggestion message using #[suggestion(message = "...")]
102 error: wrong field type for suggestion
103 --> $DIR/session-derive-errors.rs:194:5
105 LL | / #[suggestion(message = "This is a message", code = "This is suggested code")]
107 LL | | suggestion: Applicability,
108 | |_____________________________^
110 = help: #[suggestion(...)] should be applied to fields of type Span or (Span, Applicability)
112 error: type of field annotated with `#[suggestion(...)]` contains more than one Span
113 --> $DIR/session-derive-errors.rs:209:5
115 LL | / #[suggestion(message = "This is a message", code = "This is suggested code")]
117 LL | | suggestion: (Span, Span, Applicability),
118 | |___________________________________________^
120 error: type of field annotated with `#[suggestion(...)]` contains more than one Applicability
121 --> $DIR/session-derive-errors.rs:217:5
123 LL | / #[suggestion(message = "This is a message", code = "This is suggested code")]
125 LL | | suggestion: (Applicability, Applicability, Span),
126 | |____________________________________________________^
128 error: invalid annotation list `#[label(...)]`
129 --> $DIR/session-derive-errors.rs:225:7
131 LL | #[label("wrong kind of annotation for label")]
132 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
134 error: aborting due to 18 previous errors