From 88e318b13b9b8b0b93c2b081ee0ae78e47f0f468 Mon Sep 17 00:00:00 2001 From: Mikhail Modin Date: Wed, 10 Aug 2016 09:43:36 +0300 Subject: [PATCH] fix #35501 part of #35233 --- src/librustc_typeck/lib.rs | 6 ++++-- src/test/compile-fail/E0045.rs | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/librustc_typeck/lib.rs b/src/librustc_typeck/lib.rs index 65e00705121a7..cd9fbba89b9de 100644 --- a/src/librustc_typeck/lib.rs +++ b/src/librustc_typeck/lib.rs @@ -181,8 +181,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, - "variadic function must have C calling convention"); + struct_span_err!(tcx.sess, span, E0045, + "variadic function must have C calling convention") + .span_label(span, &format!("variadics require C calling conventions")) + .emit() } } diff --git a/src/test/compile-fail/E0045.rs b/src/test/compile-fail/E0045.rs index 2a731596b4be8..eae951334a443 100644 --- a/src/test/compile-fail/E0045.rs +++ b/src/test/compile-fail/E0045.rs @@ -9,6 +9,7 @@ // except according to those terms. extern "Rust" { fn foo(x: u8, ...); } //~ ERROR E0045 +//~^ NOTE variadics require C calling conventions fn main() { }