Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update error format for E0458, E0459 #36070

Merged
merged 2 commits into from
Sep 4, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions src/librustc_metadata/creader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -965,8 +965,9 @@ impl<'a> LocalCrateReader<'a> {
Some("dylib") => cstore::NativeUnknown,
Some("framework") => cstore::NativeFramework,
Some(k) => {
span_err!(self.sess, m.span, E0458,
"unknown kind: `{}`", k);
struct_span_err!(self.sess, m.span, E0458,
"unknown kind: `{}`", k)
.span_label(m.span, &format!("unknown kind")).emit();
cstore::NativeUnknown
}
None => cstore::NativeUnknown
Expand All @@ -977,8 +978,9 @@ impl<'a> LocalCrateReader<'a> {
let n = match n {
Some(n) => n,
None => {
span_err!(self.sess, m.span, E0459,
"#[link(...)] specified without `name = \"foo\"`");
struct_span_err!(self.sess, m.span, E0459,
"#[link(...)] specified without `name = \"foo\"`")
.span_label(m.span, &format!("missing `name` argument")).emit();
InternedString::new("foo")
}
};
Expand Down
4 changes: 3 additions & 1 deletion src/test/compile-fail/E0458.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
// except according to those terms.

#[link(kind = "wonderful_unicorn")] extern {} //~ ERROR E0458
//~^ ERROR E0459
//~| NOTE unknown kind
//~| ERROR E0459
//~| NOTE missing `name` argument

fn main() {
}
1 change: 1 addition & 0 deletions src/test/compile-fail/E0459.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
// except according to those terms.

#[link(kind = "dylib")] extern {} //~ ERROR E0459
//~| NOTE missing `name` argument

fn main() {
}