Skip to content

Commit

Permalink
Rollup merge of rust-lang#35541 - hank-der-hafenarbeiter:E0045, r=jon…
Browse files Browse the repository at this point in the history
…athandturner

Updated E0045 to new error format (no bonus)

Part of rust-lang#35501
r? @jonathandturner
  • Loading branch information
steveklabnik authored Aug 10, 2016
2 parents 0e71e44 + 2adc07f commit 01d61a1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/librustc_typeck/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}

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

0 comments on commit 01d61a1

Please sign in to comment.