From 65249a5431bbc3bf6b0f0894aefcc28c76eb17bb Mon Sep 17 00:00:00 2001 From: Gavin Baker Date: Sun, 28 Aug 2016 22:55:39 +1000 Subject: [PATCH 1/2] E0459 Update error format #35933 - Fixes #35933 - Part of #35233 r? @jonathandturner --- src/librustc_metadata/creader.rs | 5 +++-- src/test/compile-fail/E0459.rs | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/librustc_metadata/creader.rs b/src/librustc_metadata/creader.rs index 46469efea6bc8..b84c3e8a5bc25 100644 --- a/src/librustc_metadata/creader.rs +++ b/src/librustc_metadata/creader.rs @@ -977,8 +977,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") } }; diff --git a/src/test/compile-fail/E0459.rs b/src/test/compile-fail/E0459.rs index dc7ac714f2239..41376bd9ef5a2 100644 --- a/src/test/compile-fail/E0459.rs +++ b/src/test/compile-fail/E0459.rs @@ -9,6 +9,7 @@ // except according to those terms. #[link(kind = "dylib")] extern {} //~ ERROR E0459 + //~| NOTE missing `name` argument fn main() { } From 0412fa8b8e00bebc2bb0ad17a7e558f13b8954a7 Mon Sep 17 00:00:00 2001 From: Gavin Baker Date: Sun, 28 Aug 2016 23:55:43 +1000 Subject: [PATCH 2/2] E0458 Update error format #35932 - Fixes #35932 - Part of #35233 r? @jonathandturner --- src/librustc_metadata/creader.rs | 5 +++-- src/test/compile-fail/E0458.rs | 4 +++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/librustc_metadata/creader.rs b/src/librustc_metadata/creader.rs index b84c3e8a5bc25..8f4e9f941c600 100644 --- a/src/librustc_metadata/creader.rs +++ b/src/librustc_metadata/creader.rs @@ -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 diff --git a/src/test/compile-fail/E0458.rs b/src/test/compile-fail/E0458.rs index 21bedc6b84c2b..e87158ae3b03f 100644 --- a/src/test/compile-fail/E0458.rs +++ b/src/test/compile-fail/E0458.rs @@ -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() { }