Changes to diagnostics

This commit is contained in:
Jonathan Brouwer
2025-07-07 09:10:38 +02:00
parent 6133c676d7
commit c7f5ddc098
15 changed files with 162 additions and 97 deletions

View File

@@ -593,7 +593,13 @@ impl<'a, G: EmissionGuarantee> Diagnostic<'a, G> for AttributeParseError {
diag.code(E0565);
}
AttributeParseErrorReason::ExpectedNameValue(None) => {
// The suggestion we add below this match already contains enough information
// If the span is the entire attribute, the suggestion we add below this match already contains enough information
if self.span != self.attr_span {
diag.span_label(
self.span,
format!("expected this to be of the form `... = \"...\"`"),
);
}
}
AttributeParseErrorReason::ExpectedNameValue(Some(name)) => {
diag.span_label(