Skip to content

Commit ce68ce6

Browse files
committed
Document multipart_suggestion derive on SessionSubdiagnostic
1 parent c2371da commit ce68ce6

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

src/diagnostics/diagnostic-structs.md

+14-2
Original file line numberDiff line numberDiff line change
@@ -376,10 +376,22 @@ 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 to multipart suggestions)
380386
- _Applied to `Span` fields._
381387
- Indicates the primary span of the subdiagnostic.
382-
- `#[applicability]` (_Optional_; only applicable to suggestions)
388+
- `#[suggestion_part(code = "...")]` (_Mandatory_; only applicable to multipart suggestions)
389+
- _Applied to `Span` fields._
390+
- Indicates the span to be one part of the multipart suggestion.
391+
- `code = "..."` (_Mandatory_)
392+
- Value is a format string indicating the code to be suggested as a
393+
replacement.
394+
- `#[applicability]` (_Optional_; only applicable to (simple and multipart) suggestions)
383395
- _Applied to `Applicability` fields._
384396
- Indicates the applicability of the suggestion.
385397
- `#[skip_arg]` (_Optional_)

0 commit comments

Comments
 (0)