diff options
| author | Jonathan Brouwer <jonathantbrouwer@gmail.com> | 2025-07-07 09:10:38 +0200 |
|---|---|---|
| committer | Jonathan Brouwer <jonathantbrouwer@gmail.com> | 2025-07-15 09:21:27 +0200 |
| commit | c7f5ddc09871dc74c9f451435b042707eef5dc6c (patch) | |
| tree | 263277570b049f70da71b635970048ebb434efda /compiler/rustc_attr_parsing/src | |
| parent | 6133c676d7b5e025121c858c4e7942cce70adf27 (diff) | |
| download | rust-c7f5ddc09871dc74c9f451435b042707eef5dc6c.tar.gz rust-c7f5ddc09871dc74c9f451435b042707eef5dc6c.zip | |
Changes to diagnostics
Diffstat (limited to 'compiler/rustc_attr_parsing/src')
| -rw-r--r-- | compiler/rustc_attr_parsing/src/session_diagnostics.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/compiler/rustc_attr_parsing/src/session_diagnostics.rs b/compiler/rustc_attr_parsing/src/session_diagnostics.rs index 8a240639d75..97bf3d1c549 100644 --- a/compiler/rustc_attr_parsing/src/session_diagnostics.rs +++ b/compiler/rustc_attr_parsing/src/session_diagnostics.rs @@ -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( |
