Skip to content

Commit

Permalink
Rollup merge of rust-lang#36070 - gavinb:master, r=jonathandturner
Browse files Browse the repository at this point in the history
Update error format for E0458, E0459

Fixes rust-lang#35933, rust-lang#35932
Part of rust-lang#35233

r? @jonathandturner
  • Loading branch information
Manishearth authored Sep 4, 2016
2 parents 70598e0 + 0412fa8 commit 2e1669f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
10 changes: 6 additions & 4 deletions src/librustc_metadata/creader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1056,8 +1056,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 @@ -1068,8 +1069,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() {
}

0 comments on commit 2e1669f

Please sign in to comment.