Skip to content

Commit aa2abc9

Browse files
committed
tests: move diagnostic derive test to directory
Move existing test for session diagnostic derive to a subdirectory. Signed-off-by: David Wood <[email protected]>
1 parent 73fa217 commit aa2abc9

File tree

2 files changed

+41
-41
lines changed

2 files changed

+41
-41
lines changed

src/test/ui-fulldeps/session-derive-errors.stderr renamed to src/test/ui-fulldeps/session-diagnostic/diagnostic-derive.stderr

Lines changed: 41 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: `#[derive(SessionDiagnostic)]` can only be used on structs
2-
--> $DIR/session-derive-errors.rs:37:1
2+
--> $DIR/diagnostic-derive.rs:37:1
33
|
44
LL | / #[error(code = "E0123", slug = "foo")]
55
LL | |
@@ -10,19 +10,19 @@ LL | | }
1010
| |_^
1111

1212
error: `#[error = ...]` is not a valid `SessionDiagnostic` struct attribute
13-
--> $DIR/session-derive-errors.rs:46:1
13+
--> $DIR/diagnostic-derive.rs:46:1
1414
|
1515
LL | #[error = "E0123"]
1616
| ^^^^^^^^^^^^^^^^^^
1717

1818
error: `#[nonsense(...)]` is not a valid `SessionDiagnostic` struct attribute
19-
--> $DIR/session-derive-errors.rs:51:1
19+
--> $DIR/diagnostic-derive.rs:51:1
2020
|
2121
LL | #[nonsense(code = "E0123", slug = "foo")]
2222
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2323

2424
error: diagnostic kind not specified
25-
--> $DIR/session-derive-errors.rs:51:1
25+
--> $DIR/diagnostic-derive.rs:51:1
2626
|
2727
LL | / #[nonsense(code = "E0123", slug = "foo")]
2828
LL | |
@@ -34,13 +34,13 @@ LL | | struct InvalidStructAttr {}
3434
= help: use the `#[error(...)]` attribute to create an error
3535

3636
error: `#[error("...")]` is not a valid `SessionDiagnostic` struct attribute
37-
--> $DIR/session-derive-errors.rs:58:9
37+
--> $DIR/diagnostic-derive.rs:58:9
3838
|
3939
LL | #[error("E0123")]
4040
| ^^^^^^^
4141

4242
error: `slug` not specified
43-
--> $DIR/session-derive-errors.rs:58:1
43+
--> $DIR/diagnostic-derive.rs:58:1
4444
|
4545
LL | / #[error("E0123")]
4646
LL | |
@@ -51,95 +51,95 @@ LL | | struct InvalidLitNestedAttr {}
5151
= help: use the `#[error(slug = "...")]` attribute to set this diagnostic's slug
5252

5353
error: `#[error(nonsense)]` is not a valid `SessionDiagnostic` struct attribute
54-
--> $DIR/session-derive-errors.rs:64:9
54+
--> $DIR/diagnostic-derive.rs:64:9
5555
|
5656
LL | #[error(nonsense, code = "E0123", slug = "foo")]
5757
| ^^^^^^^^
5858

5959
error: `#[error(nonsense(...))]` is not a valid `SessionDiagnostic` struct attribute
60-
--> $DIR/session-derive-errors.rs:69:9
60+
--> $DIR/diagnostic-derive.rs:69:9
6161
|
6262
LL | #[error(nonsense("foo"), code = "E0123", slug = "foo")]
6363
| ^^^^^^^^^^^^^^^
6464

6565
error: `#[error(nonsense = ...)]` is not a valid `SessionDiagnostic` struct attribute
66-
--> $DIR/session-derive-errors.rs:74:9
66+
--> $DIR/diagnostic-derive.rs:74:9
6767
|
6868
LL | #[error(nonsense = "...", code = "E0123", slug = "foo")]
6969
| ^^^^^^^^^^^^^^^^
7070

7171
error: `#[error(nonsense = ...)]` is not a valid `SessionDiagnostic` struct attribute
72-
--> $DIR/session-derive-errors.rs:79:9
72+
--> $DIR/diagnostic-derive.rs:79:9
7373
|
7474
LL | #[error(nonsense = 4, code = "E0123", slug = "foo")]
7575
| ^^^^^^^^^^^^
7676
|
7777
= help: value must be a string
7878

7979
error: `#[suggestion = ...]` is not a valid `SessionDiagnostic` field attribute
80-
--> $DIR/session-derive-errors.rs:86:5
80+
--> $DIR/diagnostic-derive.rs:86:5
8181
|
8282
LL | #[suggestion = "bar"]
8383
| ^^^^^^^^^^^^^^^^^^^^^
8484

8585
error: `error` specified multiple times
86-
--> $DIR/session-derive-errors.rs:93:1
86+
--> $DIR/diagnostic-derive.rs:93:1
8787
|
8888
LL | #[error(code = "E0456", slug = "bar")]
8989
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
9090
|
9191
note: previously specified here
92-
--> $DIR/session-derive-errors.rs:92:1
92+
--> $DIR/diagnostic-derive.rs:92:1
9393
|
9494
LL | #[error(code = "E0123", slug = "foo")]
9595
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
9696

9797
error: `warning` specified when `error` was already specified
98-
--> $DIR/session-derive-errors.rs:98:1
98+
--> $DIR/diagnostic-derive.rs:98:1
9999
|
100100
LL | #[warning(code = "E0293", slug = "bar")]
101101
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
102102
|
103103
note: previously specified here
104-
--> $DIR/session-derive-errors.rs:97:1
104+
--> $DIR/diagnostic-derive.rs:97:1
105105
|
106106
LL | #[error(code = "E0123", slug = "foo")]
107107
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
108108

109109
error: `code` specified multiple times
110-
--> $DIR/session-derive-errors.rs:103:32
110+
--> $DIR/diagnostic-derive.rs:103:32
111111
|
112112
LL | #[error(code = "E0456", code = "E0457", slug = "bar")]
113113
| ^^^^^^^
114114
|
115115
note: previously specified here
116-
--> $DIR/session-derive-errors.rs:103:16
116+
--> $DIR/diagnostic-derive.rs:103:16
117117
|
118118
LL | #[error(code = "E0456", code = "E0457", slug = "bar")]
119119
| ^^^^^^^
120120

121121
error: `slug` specified multiple times
122-
--> $DIR/session-derive-errors.rs:107:46
122+
--> $DIR/diagnostic-derive.rs:107:46
123123
|
124124
LL | #[error(code = "E0456", slug = "foo", slug = "bar")]
125125
| ^^^^^
126126
|
127127
note: previously specified here
128-
--> $DIR/session-derive-errors.rs:107:32
128+
--> $DIR/diagnostic-derive.rs:107:32
129129
|
130130
LL | #[error(code = "E0456", slug = "foo", slug = "bar")]
131131
| ^^^^^
132132

133133
error: diagnostic kind not specified
134-
--> $DIR/session-derive-errors.rs:111:1
134+
--> $DIR/diagnostic-derive.rs:111:1
135135
|
136136
LL | struct KindNotProvided {}
137137
| ^^^^^^^^^^^^^^^^^^^^^^^^^
138138
|
139139
= help: use the `#[error(...)]` attribute to create an error
140140

141141
error: `slug` not specified
142-
--> $DIR/session-derive-errors.rs:114:1
142+
--> $DIR/diagnostic-derive.rs:114:1
143143
|
144144
LL | / #[error(code = "E0456")]
145145
LL | | struct SlugNotProvided {}
@@ -148,31 +148,31 @@ LL | | struct SlugNotProvided {}
148148
= help: use the `#[error(slug = "...")]` attribute to set this diagnostic's slug
149149

150150
error: the `#[primary_span]` attribute can only be applied to fields of type `Span`
151-
--> $DIR/session-derive-errors.rs:124:5
151+
--> $DIR/diagnostic-derive.rs:124:5
152152
|
153153
LL | #[primary_span]
154154
| ^^^^^^^^^^^^^^^
155155

156156
error: `#[nonsense]` is not a valid `SessionDiagnostic` field attribute
157-
--> $DIR/session-derive-errors.rs:132:5
157+
--> $DIR/diagnostic-derive.rs:132:5
158158
|
159159
LL | #[nonsense]
160160
| ^^^^^^^^^^^
161161

162162
error: the `#[label = ...]` attribute can only be applied to fields of type `Span`
163-
--> $DIR/session-derive-errors.rs:149:5
163+
--> $DIR/diagnostic-derive.rs:149:5
164164
|
165165
LL | #[label = "bar"]
166166
| ^^^^^^^^^^^^^^^^
167167

168168
error: `name` doesn't refer to a field on this type
169-
--> $DIR/session-derive-errors.rs:157:42
169+
--> $DIR/diagnostic-derive.rs:157:42
170170
|
171171
LL | #[suggestion(message = "bar", code = "{name}")]
172172
| ^^^^^^^^
173173

174174
error: invalid format string: expected `'}'` but string was terminated
175-
--> $DIR/session-derive-errors.rs:162:16
175+
--> $DIR/diagnostic-derive.rs:162:16
176176
|
177177
LL | #[derive(SessionDiagnostic)]
178178
| - ^ expected `'}'` in format string
@@ -183,7 +183,7 @@ LL | #[derive(SessionDiagnostic)]
183183
= note: this error originates in the derive macro `SessionDiagnostic` (in Nightly builds, run with -Z macro-backtrace for more info)
184184

185185
error: invalid format string: unmatched `}` found
186-
--> $DIR/session-derive-errors.rs:172:15
186+
--> $DIR/diagnostic-derive.rs:172:15
187187
|
188188
LL | #[derive(SessionDiagnostic)]
189189
| ^ unmatched `}` in format string
@@ -192,25 +192,25 @@ LL | #[derive(SessionDiagnostic)]
192192
= note: this error originates in the derive macro `SessionDiagnostic` (in Nightly builds, run with -Z macro-backtrace for more info)
193193

194194
error: the `#[label = ...]` attribute can only be applied to fields of type `Span`
195-
--> $DIR/session-derive-errors.rs:192:5
195+
--> $DIR/diagnostic-derive.rs:192:5
196196
|
197197
LL | #[label = "bar"]
198198
| ^^^^^^^^^^^^^^^^
199199

200200
error: `#[suggestion(nonsense = ...)]` is not a valid `SessionDiagnostic` field attribute
201-
--> $DIR/session-derive-errors.rs:217:18
201+
--> $DIR/diagnostic-derive.rs:217:18
202202
|
203203
LL | #[suggestion(nonsense = "bar")]
204204
| ^^^^^^^^^^^^^^^^
205205

206206
error: `#[suggestion(msg = ...)]` is not a valid `SessionDiagnostic` field attribute
207-
--> $DIR/session-derive-errors.rs:225:18
207+
--> $DIR/diagnostic-derive.rs:225:18
208208
|
209209
LL | #[suggestion(msg = "bar")]
210210
| ^^^^^^^^^^^
211211

212212
error: wrong field type for suggestion
213-
--> $DIR/session-derive-errors.rs:247:5
213+
--> $DIR/diagnostic-derive.rs:247:5
214214
|
215215
LL | / #[suggestion(message = "bar", code = "This is suggested code")]
216216
LL | |
@@ -220,65 +220,65 @@ LL | | suggestion: Applicability,
220220
= help: `#[suggestion(...)]` should be applied to fields of type `Span` or `(Span, Applicability)`
221221

222222
error: type of field annotated with `#[suggestion(...)]` contains more than one `Span`
223-
--> $DIR/session-derive-errors.rs:262:5
223+
--> $DIR/diagnostic-derive.rs:262:5
224224
|
225225
LL | / #[suggestion(message = "bar", code = "This is suggested code")]
226226
LL | |
227227
LL | | suggestion: (Span, Span, Applicability),
228228
| |___________________________________________^
229229

230230
error: type of field annotated with `#[suggestion(...)]` contains more than one Applicability
231-
--> $DIR/session-derive-errors.rs:270:5
231+
--> $DIR/diagnostic-derive.rs:270:5
232232
|
233233
LL | / #[suggestion(message = "bar", code = "This is suggested code")]
234234
LL | |
235235
LL | | suggestion: (Applicability, Applicability, Span),
236236
| |____________________________________________________^
237237

238238
error: `#[label(...)]` is not a valid `SessionDiagnostic` field attribute
239-
--> $DIR/session-derive-errors.rs:278:5
239+
--> $DIR/diagnostic-derive.rs:278:5
240240
|
241241
LL | #[label("bar")]
242242
| ^^^^^^^^^^^^^^^
243243

244244
error: `#[help]` must come after `#[error(..)]` or `#[warn(..)]`
245-
--> $DIR/session-derive-errors.rs:399:1
245+
--> $DIR/diagnostic-derive.rs:399:1
246246
|
247247
LL | #[help]
248248
| ^^^^^^^
249249

250250
error: `#[help = ...]` must come after `#[error(..)]` or `#[warn(..)]`
251-
--> $DIR/session-derive-errors.rs:407:1
251+
--> $DIR/diagnostic-derive.rs:407:1
252252
|
253253
LL | #[help = "bar"]
254254
| ^^^^^^^^^^^^^^^
255255

256256
error: `#[note]` must come after `#[error(..)]` or `#[warn(..)]`
257-
--> $DIR/session-derive-errors.rs:415:1
257+
--> $DIR/diagnostic-derive.rs:415:1
258258
|
259259
LL | #[note]
260260
| ^^^^^^^
261261

262262
error: `#[note = ...]` must come after `#[error(..)]` or `#[warn(..)]`
263-
--> $DIR/session-derive-errors.rs:423:1
263+
--> $DIR/diagnostic-derive.rs:423:1
264264
|
265265
LL | #[note = "bar"]
266266
| ^^^^^^^^^^^^^^^
267267

268268
error: cannot find attribute `nonsense` in this scope
269-
--> $DIR/session-derive-errors.rs:51:3
269+
--> $DIR/diagnostic-derive.rs:51:3
270270
|
271271
LL | #[nonsense(code = "E0123", slug = "foo")]
272272
| ^^^^^^^^
273273

274274
error: cannot find attribute `nonsense` in this scope
275-
--> $DIR/session-derive-errors.rs:132:7
275+
--> $DIR/diagnostic-derive.rs:132:7
276276
|
277277
LL | #[nonsense]
278278
| ^^^^^^^^
279279

280280
error[E0599]: no method named `into_diagnostic_arg` found for struct `Hello` in the current scope
281-
--> $DIR/session-derive-errors.rs:322:10
281+
--> $DIR/diagnostic-derive.rs:322:10
282282
|
283283
LL | struct Hello {}
284284
| ------------ method `into_diagnostic_arg` not found for this

0 commit comments

Comments
 (0)