11error: `#[derive(SessionDiagnostic)]` can only be used on structs
22  --> $DIR/session-derive-errors.rs:28:1
33   |
4- LL | / #[error = "E0123"]
5- LL | |
6- LL | | enum SessionDiagnosticOnEnum {
7- LL | |     Foo,
8- LL | |     Bar,
9- LL | | }
10-    | |_^
4+ LL | #[error = "E0123"]
5+    | ^
116
127error: `#[label = ...]` is not a valid SessionDiagnostic struct attribute
138  --> $DIR/session-derive-errors.rs:37:1
149   |
1510LL | #[label = "This is in the wrong place"]
16-    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 
11+    | ^
1712
1813error: `#[suggestion = ...]` is not a valid SessionDiagnostic field attribute
1914  --> $DIR/session-derive-errors.rs:44:5
2015   |
2116LL |     #[suggestion = "this is the wrong kind of attribute"]
22-    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 
17+    |     ^
2318
2419error: `error` specified multiple times
2520  --> $DIR/session-derive-errors.rs:52:11
@@ -37,21 +32,21 @@ error: `code` not specified
3732  --> $DIR/session-derive-errors.rs:67:1
3833   |
3934LL | struct ErrorCodeNotProvided {}
40-    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 
35+    | ^^^^^^
4136   |
4237   = help: use the [code = "..."] attribute to set this diagnostic's error code 
4338
4439error: the `#[message = "..."]` attribute can only be applied to fields of type Span
4540  --> $DIR/session-derive-errors.rs:95:5
4641   |
4742LL |     #[message = "this message is applied to a String field"]
48-    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 
43+    |     ^
4944
5045error: `name` doesn't refer to a field on this type
5146  --> $DIR/session-derive-errors.rs:102:1
5247   |
5348LL | #[message = "This error has a field, and references {name}"]
54-    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 
49+    | ^
5550
5651error: invalid format string: expected `'}'` but string was terminated
5752  --> $DIR/session-derive-errors.rs:110:1
@@ -77,59 +72,53 @@ error: The `#[label = ...]` attribute can only be applied to fields of type Span
7772  --> $DIR/session-derive-errors.rs:138:5
7873   |
7974LL |     #[label = "See here"]
80-    |     ^^^^^^^^^^^^^^^^^^^^^ 
75+    |     ^
8176
8277error: `nonsense` is not a valid key for `#[suggestion(...)]`
8378  --> $DIR/session-derive-errors.rs:163:18
8479   |
8580LL |     #[suggestion(nonsense = "This is nonsense")]
86-    |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 
81+    |                  ^^^^^^^^
8782
8883error: `msg` is not a valid key for `#[suggestion(...)]`
8984  --> $DIR/session-derive-errors.rs:171:18
9085   |
9186LL |     #[suggestion(msg = "This is a suggestion")]
92-    |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 
87+    |                  ^^^
9388
9489error: missing suggestion message
9590  --> $DIR/session-derive-errors.rs:179:7
9691   |
9792LL |     #[suggestion(code = "This is suggested code")]
98-    |       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 
93+    |       ^^^^^^^^^^
9994   |
10095   = help: provide a suggestion message using #[suggestion(message = "...")]
10196
10297error: wrong field type for suggestion
10398  --> $DIR/session-derive-errors.rs:194:5
10499   |
105- LL | /     #[suggestion(message = "This is a message", code = "This is suggested code")]
106- LL | |
107- LL | |     suggestion: Applicability,
108-    | |_____________________________^
100+ LL |     #[suggestion(message = "This is a message", code = "This is suggested code")]
101+    |     ^
109102   |
110103   = help: #[suggestion(...)] should be applied to fields of type Span or (Span, Applicability)
111104
112105error: type of field annotated with `#[suggestion(...)]` contains more than one Span
113106  --> $DIR/session-derive-errors.rs:209:5
114107   |
115- LL | /     #[suggestion(message = "This is a message", code = "This is suggested code")]
116- LL | |
117- LL | |     suggestion: (Span, Span, Applicability),
118-    | |___________________________________________^
108+ LL |     #[suggestion(message = "This is a message", code = "This is suggested code")]
109+    |     ^
119110
120111error: type of field annotated with `#[suggestion(...)]` contains more than one Applicability
121112  --> $DIR/session-derive-errors.rs:217:5
122113   |
123- LL | /     #[suggestion(message = "This is a message", code = "This is suggested code")]
124- LL | |
125- LL | |     suggestion: (Applicability, Applicability, Span),
126-    | |____________________________________________________^
114+ LL |     #[suggestion(message = "This is a message", code = "This is suggested code")]
115+    |     ^
127116
128117error: invalid annotation list `#[label(...)]`
129118  --> $DIR/session-derive-errors.rs:225:7
130119   |
131120LL |     #[label("wrong kind of annotation for label")]
132-    |       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 
121+    |       ^^^^^
133122
134123error: aborting due to 18 previous errors
135124
0 commit comments