Skip to content

Commit 689c6f2

Browse files
committed
Ty FnSigs no longer have the variadic param
As of commit a88d181a023e in rustc, HIR and Ty level IR no longer carries the variadic dummy param, so we don't need to subtract 1 from the number of arguments.
1 parent 1d5a86f commit 689c6f2

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

c2rust-refactor/src/illtyped.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,10 +140,8 @@ impl<'a, 'tcx, F: IlltypedFolder<'tcx>> MutVisitor for FoldIlltyped<'a, 'tcx, F>
140140
ExprKind::Call(_callee, args) => {
141141
if let Some(fn_sig) = opt_fn_sig {
142142
for (i, arg) in args.iter_mut().enumerate() {
143-
if !fn_sig.c_variadic || i < fn_sig.inputs().len() - 1 {
144-
if let Some(&ty) = fn_sig.inputs().get(i) {
145-
illtyped |= self.ensure(arg, ty);
146-
}
143+
if let Some(&ty) = fn_sig.inputs().get(i) {
144+
illtyped |= self.ensure(arg, ty);
147145
}
148146
}
149147
}

0 commit comments

Comments
 (0)