Skip to content

Commit c701490

Browse files
author
Jonathan Turner
authored
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
2 parents 5284bee + 18434f9 commit c701490

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/libsyntax/attr.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -438,8 +438,9 @@ pub fn find_export_name_attr(diag: &Handler, attrs: &[Attribute]) -> Option<Inte
438438
} else {
439439
struct_span_err!(diag, attr.span, E0558,
440440
"export_name attribute has invalid format")
441-
.help("use #[export_name=\"*\"]")
442-
.emit();
441+
.span_label(attr.span,
442+
&format!("did you mean #[export_name=\"*\"]?"))
443+
.emit();
443444
None
444445
}
445446
} else {

src/test/compile-fail/E0558.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#[export_name] //~ ERROR E0558
11+
#[export_name]
12+
//~^ ERROR E0558
13+
//~| NOTE did you mean #[export_name="*"]?
14+
1215
pub fn something() {}
1316

1417
fn main() {}

0 commit comments

Comments
 (0)