Skip to content

Commit 01d61a1

Browse files
authored
Rollup merge of rust-lang#35541 - hank-der-hafenarbeiter:E0045, r=jonathandturner
Updated E0045 to new error format (no bonus) Part of rust-lang#35501 r? @jonathandturner
2 parents 0e71e44 + 2adc07f commit 01d61a1

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/librustc_typeck/lib.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,10 @@ fn require_c_abi_if_variadic(tcx: TyCtxt,
178178
abi: Abi,
179179
span: Span) {
180180
if decl.variadic && abi != Abi::C {
181-
span_err!(tcx.sess, span, E0045,
181+
let mut err = struct_span_err!(tcx.sess, span, E0045,
182182
"variadic function must have C calling convention");
183+
err.span_label(span, &("variadics require C calling conventions").to_string())
184+
.emit();
183185
}
184186
}
185187

src/test/compile-fail/E0045.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
extern "Rust" { fn foo(x: u8, ...); } //~ ERROR E0045
11+
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)