Skip to content

Commit 2f2df2a

Browse files
committed
Update compiler error E0558 to use new error format
Fixes #36196 part of #35233
1 parent 147371f commit 2f2df2a

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/libsyntax/attr.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,7 @@ 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=\"*\"]")
441+
.span_label(attr.span, &format!("did you mean #[export_name=\"*\"]?"))
442442
.emit();
443443
None
444444
}

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)