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

Update error format #35501 #35563

Closed
wants to merge 1 commit into from
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() {
}