diff options
| author | Michael Goulet <michael@errs.io> | 2023-05-03 23:22:57 +0000 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2023-05-08 03:19:54 +0000 |
| commit | 2b9279f3131056a1a1dd5de7513de4eb98987770 (patch) | |
| tree | c02f865cc084f3226777b785183bb4d888869b7b /compiler/rustc_macros/src/diagnostics/utils.rs | |
| parent | ad6b20bf5225c65aab30169c9a173719f5bdfc04 (diff) | |
| download | rust-2b9279f3131056a1a1dd5de7513de4eb98987770.tar.gz rust-2b9279f3131056a1a1dd5de7513de4eb98987770.zip | |
Diagnostic args are still args if they're documented
Diffstat (limited to 'compiler/rustc_macros/src/diagnostics/utils.rs')
| -rw-r--r-- | compiler/rustc_macros/src/diagnostics/utils.rs | 3 |
1 files changed, 2 insertions, 1 deletions
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 { |
