Skip to content

Commit d460597

Browse files
committed
trans: monomorphize varidiac call argument types.
1 parent 9709dff commit d460597

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/librustc_trans/mir/block.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,8 @@ impl<'bcx, 'tcx> MirContext<'bcx, 'tcx> {
213213

214214
let extra_args = &args[sig.inputs.len()..];
215215
let extra_args = extra_args.iter().map(|op_arg| {
216-
self.mir.operand_ty(bcx.tcx(), op_arg)
216+
let op_ty = self.mir.operand_ty(bcx.tcx(), op_arg);
217+
bcx.monomorphize(&op_ty)
217218
}).collect::<Vec<_>>();
218219
let fn_ty = callee.direct_fn_type(bcx.ccx(), &extra_args);
219220

src/test/run-pass/mir_trans_calls_variadic.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,17 @@ extern {
1616
}
1717

1818
#[rustc_mir]
19-
fn test(a: i64, b: i64, c: i64, d: i64, e: i64, f: i64) -> i64 {
19+
fn test<T, U>(a: i64, b: i64, c: i64, d: i64, e: i64, f: T, g: U) -> i64 {
2020
unsafe {
2121
rust_interesting_average(6, a, a as f64,
2222
b, b as f64,
2323
c, c as f64,
2424
d, d as f64,
2525
e, e as f64,
26-
f, f as f64) as i64
26+
f, g) as i64
2727
}
2828
}
2929

3030
fn main(){
31-
assert_eq!(test(10, 20, 30, 40, 50, 60), 70);
31+
assert_eq!(test(10, 20, 30, 40, 50, 60_i64, 60.0_f64), 70);
3232
}

0 commit comments

Comments
 (0)