Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated E0045 to new error format (no bonus) #35541

Merged
merged 2 commits into from
Aug 12, 2016
Merged
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
4 changes: 3 additions & 1 deletion 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,
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() {
}