diff options
| author | Jonathan Turner <jonathandturner@users.noreply.github.com> | 2016-09-02 15:28:52 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-09-02 15:28:52 -0700 |
| commit | c70149004ac57c17d0cf73b6738464fea96abbab (patch) | |
| tree | f558d88c104cc02ae35c3c6619b82d04426e1192 | |
| parent | 5284bee03a94cf5c9c8a84f42c17f563ae76bca4 (diff) | |
| parent | 18434f94572ee047aff8898a0d25ee8939585827 (diff) | |
Rollup merge of #36223 - abhiQmar:e0558-formatting, r=jonathandturner
Update compiler error E0558 to use new error format Fixes #36196 part of #35233 r? @jonathandturner
| -rw-r--r-- | src/libsyntax/attr.rs | 5 | ||||
| -rw-r--r-- | src/test/compile-fail/E0558.rs | 5 |
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() {} |
