From 2b9279f3131056a1a1dd5de7513de4eb98987770 Mon Sep 17 00:00:00 2001 From: Michael Goulet Date: Wed, 3 May 2023 23:22:57 +0000 Subject: Diagnostic args are still args if they're documented --- compiler/rustc_macros/src/diagnostics/utils.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'compiler/rustc_macros/src/diagnostics/utils.rs') diff --git a/compiler/rustc_macros/src/diagnostics/utils.rs b/compiler/rustc_macros/src/diagnostics/utils.rs index b9b09c66230..bc97e39bebd 100644 --- a/compiler/rustc_macros/src/diagnostics/utils.rs +++ b/compiler/rustc_macros/src/diagnostics/utils.rs @@ -851,7 +851,8 @@ impl quote::IdentFragment for SubdiagnosticKind { /// Returns `true` if `field` should generate a `set_arg` call rather than any other diagnostic /// call (like `span_label`). pub(super) fn should_generate_set_arg(field: &Field) -> bool { - field.attrs.is_empty() + // Perhaps this should be an exhaustive list... + field.attrs.iter().all(|attr| is_doc_comment(attr)) } pub(super) fn is_doc_comment(attr: &Attribute) -> bool { -- cgit 1.4.1-3-g733a5