Skip to content

Commit

Permalink
Ty FnSigs no longer have the variadic param
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
rinon committed Oct 1, 2019
1 parent 1d5a86f commit 689c6f2
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions c2rust-refactor/src/illtyped.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,8 @@ impl<'a, 'tcx, F: IlltypedFolder<'tcx>> MutVisitor for FoldIlltyped<'a, 'tcx, F>
ExprKind::Call(_callee, args) => {
if let Some(fn_sig) = opt_fn_sig {
for (i, arg) in args.iter_mut().enumerate() {
if !fn_sig.c_variadic || i < fn_sig.inputs().len() - 1 {
if let Some(&ty) = fn_sig.inputs().get(i) {
illtyped |= self.ensure(arg, ty);
}
if let Some(&ty) = fn_sig.inputs().get(i) {
illtyped |= self.ensure(arg, ty);
}
}
}
Expand Down

0 comments on commit 689c6f2

Please sign in to comment.