about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJonathan Turner <jonathandturner@users.noreply.github.com>2016-08-11 06:34:00 -0700
committerGitHub <noreply@github.com>2016-08-11 06:34:00 -0700
commit08d5df8f5f709741c5bc78183b4ed0ac3657cb9f (patch)
treea641984f086e483682ef8cec4bb342405c8e3eb5
parent8d63269b8a04c24f49c75b62d43f7e8496e3653a (diff)
parent2adc07f462fbd9bc2dc4a3b756d1e580fa337558 (diff)
downloadrust-08d5df8f5f709741c5bc78183b4ed0ac3657cb9f.tar.gz
rust-08d5df8f5f709741c5bc78183b4ed0ac3657cb9f.zip
Rollup merge of #35541 - hank-der-hafenarbeiter:E0045, r=jonathandturner
Updated E0045 to new error format (no bonus)

Part of #35501
r? @jonathandturner
-rw-r--r--src/librustc_typeck/lib.rs4
-rw-r--r--src/test/compile-fail/E0045.rs3
2 files changed, 5 insertions, 2 deletions
diff --git a/src/librustc_typeck/lib.rs b/src/librustc_typeck/lib.rs
index 5e733389e24..a31961a157b 100644
--- a/src/librustc_typeck/lib.rs
+++ b/src/librustc_typeck/lib.rs
@@ -178,8 +178,10 @@ fn require_c_abi_if_variadic(tcx: TyCtxt,
                              abi: Abi,
                              span: Span) {
     if decl.variadic && abi != Abi::C {
-        span_err!(tcx.sess, span, E0045,
+        let mut err = struct_span_err!(tcx.sess, span, E0045,
                   "variadic function must have C calling convention");
+        err.span_label(span, &("variadics require C calling conventions").to_string())
+            .emit();
     }
 }
 
diff --git a/src/test/compile-fail/E0045.rs b/src/test/compile-fail/E0045.rs
index 2a731596b4b..a3fea8e0db2 100644
--- a/src/test/compile-fail/E0045.rs
+++ b/src/test/compile-fail/E0045.rs
@@ -8,7 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-extern "Rust" { fn foo(x: u8, ...); } //~ ERROR E0045
+extern "Rust" { fn foo(x: u8, ...); }   //~ ERROR E0045
+                                        //~| NOTE variadics require C calling conventions
 
 fn main() {
 }