From 87c3776271fde26d50a62d014e3b4f47b9f40cc2 Mon Sep 17 00:00:00 2001 From: Nathan Stocks Date: Thu, 18 Aug 2022 16:08:26 -0600 Subject: [PATCH 1/3] fix incorrect #[note] syntax --- src/diagnostics/diagnostic-structs.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/diagnostics/diagnostic-structs.md b/src/diagnostics/diagnostic-structs.md index c197f234e..36ddd615b 100644 --- a/src/diagnostics/diagnostic-structs.md +++ b/src/diagnostics/diagnostic-structs.md @@ -161,7 +161,7 @@ tcx.sess.emit_err(FieldAlreadyDeclared { - See [translation documentation](./translation.md). - `code = "..."` (_Optional_) - Specifies the error code. -- `#[note]` or `#[note = "..."]` (_Optional_) +- `#[note]` or `#[note(...)]` (_Optional_) - _Applied to struct or `Span`/`()` fields._ - Adds a note subdiagnostic. - Value is the Fluent attribute (relative to the Fluent message specified by From c671456fcd3fc47cade503ca38c6f3686d9c25b5 Mon Sep 17 00:00:00 2001 From: Nathan Stocks Date: Thu, 18 Aug 2022 16:31:39 -0600 Subject: [PATCH 2/3] more syntax fixes --- src/diagnostics/diagnostic-structs.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/diagnostics/diagnostic-structs.md b/src/diagnostics/diagnostic-structs.md index 36ddd615b..d30dd180b 100644 --- a/src/diagnostics/diagnostic-structs.md +++ b/src/diagnostics/diagnostic-structs.md @@ -168,14 +168,14 @@ tcx.sess.emit_err(FieldAlreadyDeclared { `slug`) for the note's message - Defaults to `note`. - If applied to a `Span` field, creates a spanned note. -- `#[help]` or `#[help = "..."]` (_Optional_) +- `#[help]` or `#[help(...)]` (_Optional_) - _Applied to struct or `Span`/`()` fields._ - Adds a help subdiagnostic. - Value is the Fluent attribute (relative to the Fluent message specified by `slug`) for the help's message. - Defaults to `help`. - If applied to a `Span` field, creates a spanned help. -- `#[label]` or `#[label = "..."]` (_Optional_) +- `#[label]` or `#[label(...)]` (_Optional_) - _Applied to `Span` fields._ - Adds a label subdiagnostic. - Value is the Fluent attribute (relative to the Fluent message specified by From e93b92b0170339737895d77357f60ac35c51716e Mon Sep 17 00:00:00 2001 From: Nathan Stocks Date: Thu, 18 Aug 2022 18:47:41 -0600 Subject: [PATCH 3/3] add missing lifetime --- src/diagnostics/diagnostic-structs.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/diagnostics/diagnostic-structs.md b/src/diagnostics/diagnostic-structs.md index d30dd180b..f676e7ff7 100644 --- a/src/diagnostics/diagnostic-structs.md +++ b/src/diagnostics/diagnostic-structs.md @@ -113,7 +113,7 @@ In the end, the `SessionDiagnostic` derive will generate an implementation of `SessionDiagnostic` that looks like the following: ```rust,ignore -impl SessionDiagnostic for FieldAlreadyDeclared { +impl SessionDiagnostic<'_> for FieldAlreadyDeclared { fn into_diagnostic(self, sess: &'_ rustc_session::Session) -> DiagnosticBuilder<'_> { let mut diag = sess.struct_err(rustc_errors::fluent::typeck::field_already_declared); diag.set_span(self.span);