Skip to content

Commit 88e318b

Browse files
committed
fix #35501 part of #35233
1 parent b42a384 commit 88e318b

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/librustc_typeck/lib.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,10 @@ fn require_c_abi_if_variadic(tcx: TyCtxt,
181181
abi: Abi,
182182
span: Span) {
183183
if decl.variadic && abi != Abi::C {
184-
span_err!(tcx.sess, span, E0045,
185-
"variadic function must have C calling convention");
184+
struct_span_err!(tcx.sess, span, E0045,
185+
"variadic function must have C calling convention")
186+
.span_label(span, &format!("variadics require C calling conventions"))
187+
.emit()
186188
}
187189
}
188190

src/test/compile-fail/E0045.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
// except according to those terms.
1010

1111
extern "Rust" { fn foo(x: u8, ...); } //~ ERROR E0045
12+
//~^ NOTE variadics require C calling conventions
1213

1314
fn main() {
1415
}

0 commit comments

Comments
 (0)