Skip to content

Commit 5be5475

Browse files
Xiretzadavidtwco
authored andcommitted
Document multipart_suggestion derive on SessionSubdiagnostic
1 parent 8593238 commit 5be5475

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

src/diagnostics/diagnostic-structs.md

+15-2
Original file line numberDiff line numberDiff line change
@@ -376,10 +376,23 @@ diagnostic struct.
376376
- `maybe-incorrect`
377377
- `has-placeholders`
378378
- `unspecified`
379-
- `#[primary_span]` (_Mandatory_ for labels and suggestions; _optional_ otherwise)
379+
- `#[multipart_suggestion{,_hidden,_short,_verbose}(slug, applicability = "...")]`
380+
- _Applied to struct or enum variant. Mutually exclusive with struct/enum variant attributes._
381+
- _Mandatory_
382+
- Defines the type to be representing a multipart suggestion.
383+
- Slug (_Mandatory_): see `#[suggestion]`
384+
- `applicability = "..."` (_Optional_): see `#[suggestion]`
385+
- `#[primary_span]` (_Mandatory_ for labels and suggestions; _optional_ otherwise; not applicable
386+
to multipart suggestions)
380387
- _Applied to `Span` fields._
381388
- Indicates the primary span of the subdiagnostic.
382-
- `#[applicability]` (_Optional_; only applicable to suggestions)
389+
- `#[suggestion_part(code = "...")]` (_Mandatory_; only applicable to multipart suggestions)
390+
- _Applied to `Span` fields._
391+
- Indicates the span to be one part of the multipart suggestion.
392+
- `code = "..."` (_Mandatory_)
393+
- Value is a format string indicating the code to be suggested as a
394+
replacement.
395+
- `#[applicability]` (_Optional_; only applicable to (simple and multipart) suggestions)
383396
- _Applied to `Applicability` fields._
384397
- Indicates the applicability of the suggestion.
385398
- `#[skip_arg]` (_Optional_)

0 commit comments

Comments
 (0)