about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/libsyntax/attr.rs5
-rw-r--r--src/test/compile-fail/E0558.rs5
2 files changed, 7 insertions, 3 deletions
diff --git a/src/libsyntax/attr.rs b/src/libsyntax/attr.rs
index 703f3f7adf9..81ee96459fd 100644
--- a/src/libsyntax/attr.rs
+++ b/src/libsyntax/attr.rs
@@ -438,8 +438,9 @@ pub fn find_export_name_attr(diag: &Handler, attrs: &[Attribute]) -> Option<Inte
             } else {
                 struct_span_err!(diag, attr.span, E0558,
                                  "export_name attribute has invalid format")
-                                .help("use #[export_name=\"*\"]")
-                                .emit();
+                    .span_label(attr.span,
+                                &format!("did you mean #[export_name=\"*\"]?"))
+                    .emit();
                 None
             }
         } else {
diff --git a/src/test/compile-fail/E0558.rs b/src/test/compile-fail/E0558.rs
index 4ab0506a9c0..0c2ca698491 100644
--- a/src/test/compile-fail/E0558.rs
+++ b/src/test/compile-fail/E0558.rs
@@ -8,7 +8,10 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#[export_name] //~ ERROR E0558
+#[export_name]
+//~^ ERROR E0558
+//~| NOTE did you mean #[export_name="*"]?
+
 pub fn something() {}
 
 fn main() {}