Skip to content

Commit 3efec45

Browse files
Fix duplicate help on export_name and others
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
1 parent 66c5c7c commit 3efec45

File tree

2 files changed

+4
-16
lines changed

2 files changed

+4
-16
lines changed

‎compiler/rustc_attr_parsing/src/session_diagnostics.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -566,10 +566,7 @@ impl<'a, G: EmissionGuarantee> Diagnostic<'a, G> for AttributeParseError {
566566
diag.code(E0565);
567567
}
568568
AttributeParseErrorReason::ExpectedNameValue(None) => {
569-
diag.span_label(
570-
self.span,
571-
format!("expected this to be of the form `{name} = \"...\"`"),
572-
);
569+
// The suggestion we add below this match already contains enough information
573570
}
574571
AttributeParseErrorReason::ExpectedNameValue(Some(name)) => {
575572
diag.span_label(

‎tests/ui/attributes/malformed-attrs.stderr

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -374,10 +374,7 @@ error[E0539]: malformed `export_name` attribute input
374374
--> $DIR/malformed-attrs.rs:32:1
375375
|
376376
LL | #[unsafe(export_name)]
377-
| ^^^^^^^^^^^^^^^^^^^^^^
378-
| |
379-
| expected this to be of the form `export_name = "..."`
380-
| help: must be of the form: `#[export_name = "name"]`
377+
| ^^^^^^^^^^^^^^^^^^^^^^ help: must be of the form: `#[export_name = "name"]`
381378

382379
error: `rustc_allow_const_fn_unstable` expects a list of feature names
383380
--> $DIR/malformed-attrs.rs:34:1
@@ -424,10 +421,7 @@ error[E0539]: malformed `rustc_macro_transparency` attribute input
424421
--> $DIR/malformed-attrs.rs:45:1
425422
|
426423
LL | #[rustc_macro_transparency]
427-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
428-
| |
429-
| expected this to be of the form `rustc_macro_transparency = "..."`
430-
| help: must be of the form: `#[rustc_macro_transparency = "transparent|semitransparent|opaque"]`
424+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: must be of the form: `#[rustc_macro_transparency = "transparent|semitransparent|opaque"]`
431425

432426
error[E0539]: malformed `repr` attribute input
433427
--> $DIR/malformed-attrs.rs:47:1
@@ -511,10 +505,7 @@ error[E0539]: malformed `export_name` attribute input
511505
--> $DIR/malformed-attrs.rs:68:1
512506
|
513507
LL | #[export_name()]
514-
| ^^^^^^^^^^^^^^^^
515-
| |
516-
| expected this to be of the form `export_name = "..."`
517-
| help: must be of the form: `#[export_name = "name"]`
508+
| ^^^^^^^^^^^^^^^^ help: must be of the form: `#[export_name = "name"]`
518509

519510
error[E0805]: malformed `used` attribute input
520511
--> $DIR/malformed-attrs.rs:70:1

0 commit comments

Comments
 (0)