Skip to content
Closed
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
6 changes: 4 additions & 2 deletions src/librustc_typeck/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
}

Expand Down
1 change: 1 addition & 0 deletions src/test/compile-fail/E0045.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
}