diff options
| author | clubby789 <jamie@hill-daniel.co.uk> | 2023-04-08 20:37:41 +0100 |
|---|---|---|
| committer | clubby789 <jamie@hill-daniel.co.uk> | 2023-04-10 21:16:53 +0100 |
| commit | 64f75977764439f500f58ed6f2ac6db4873b250a (patch) | |
| tree | 774109c31b41752d791d0ceba7609d23e7a71601 /compiler/rustc_macros/src/diagnostics/diagnostic_builder.rs | |
| parent | b6f6104a1f62a0eec7d2e2ccdc07709fcc4c83f0 (diff) | |
| download | rust-64f75977764439f500f58ed6f2ac6db4873b250a.tar.gz rust-64f75977764439f500f58ed6f2ac6db4873b250a.zip | |
Migrate most of `rustc_builtin_macros` to diagnostic impls
Co-authored-by: Joe ST <joe@fbstj.net> Co-authored-by: Michael Goulet <michael@errs.io>
Diffstat (limited to 'compiler/rustc_macros/src/diagnostics/diagnostic_builder.rs')
| -rw-r--r-- | compiler/rustc_macros/src/diagnostics/diagnostic_builder.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/compiler/rustc_macros/src/diagnostics/diagnostic_builder.rs b/compiler/rustc_macros/src/diagnostics/diagnostic_builder.rs index 9b91627883a..181e65d8953 100644 --- a/compiler/rustc_macros/src/diagnostics/diagnostic_builder.rs +++ b/compiler/rustc_macros/src/diagnostics/diagnostic_builder.rs @@ -392,14 +392,16 @@ impl<'a> DiagnosticDeriveVariantBuilder<'a> { } SubdiagnosticKind::Note | SubdiagnosticKind::Help | SubdiagnosticKind::Warn => { let inner = info.ty.inner_type(); - if type_matches_path(inner, &["rustc_span", "Span"]) { + if type_matches_path(inner, &["rustc_span", "Span"]) + || type_matches_path(inner, &["rustc_span", "MultiSpan"]) + { Ok(self.add_spanned_subdiagnostic(binding, &fn_ident, slug)) } else if type_is_unit(inner) || (matches!(info.ty, FieldInnerTy::Plain(_)) && type_is_bool(inner)) { Ok(self.add_subdiagnostic(&fn_ident, slug)) } else { - report_type_error(attr, "`Span`, `bool` or `()`")? + report_type_error(attr, "`Span`, `MultiSpan`, `bool` or `()`")? } } SubdiagnosticKind::Suggestion { |
