From bd5ed63f919c508c5e12f68bfe75009da2cfb0f4 Mon Sep 17 00:00:00 2001 From: Xiretza Date: Wed, 24 Aug 2022 21:40:07 +0200 Subject: [PATCH] Document multipart_suggestion derive on SessionSubdiagnostic --- src/diagnostics/diagnostic-structs.md | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/diagnostics/diagnostic-structs.md b/src/diagnostics/diagnostic-structs.md index f456474c7..748eb89d4 100644 --- a/src/diagnostics/diagnostic-structs.md +++ b/src/diagnostics/diagnostic-structs.md @@ -376,10 +376,23 @@ diagnostic struct. - `maybe-incorrect` - `has-placeholders` - `unspecified` -- `#[primary_span]` (_Mandatory_ for labels and suggestions; _optional_ otherwise) +- `#[multipart_suggestion{,_hidden,_short,_verbose}(slug, applicability = "...")]` + - _Applied to struct or enum variant. Mutually exclusive with struct/enum variant attributes._ + - _Mandatory_ + - Defines the type to be representing a multipart suggestion. + - Slug (_Mandatory_): see `#[suggestion]` + - `applicability = "..."` (_Optional_): see `#[suggestion]` +- `#[primary_span]` (_Mandatory_ for labels and suggestions; _optional_ otherwise; not applicable +to multipart suggestions) - _Applied to `Span` fields._ - Indicates the primary span of the subdiagnostic. -- `#[applicability]` (_Optional_; only applicable to suggestions) +- `#[suggestion_part(code = "...")]` (_Mandatory_; only applicable to multipart suggestions) + - _Applied to `Span` fields._ + - Indicates the span to be one part of the multipart suggestion. + - `code = "..."` (_Mandatory_) + - Value is a format string indicating the code to be suggested as a + replacement. +- `#[applicability]` (_Optional_; only applicable to (simple and multipart) suggestions) - _Applied to `Applicability` fields._ - Indicates the applicability of the suggestion. - `#[skip_arg]` (_Optional_)