]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_codegen_llvm/src/builder.rs
Auto merge of #83357 - saethlin:vec-reserve-inlining, r=dtolnay
[rust.git] / compiler / rustc_codegen_llvm / src / builder.rs
index f4852c91e53d5a67fd1b06ba85814f7fb4808cec..896e56a9a1e3a6410d128cb6fccccad337e47464 100644 (file)
@@ -21,6 +21,7 @@
 use rustc_target::spec::{HasTargetSpec, Target};
 use std::borrow::Cow;
 use std::ffi::CStr;
+use std::iter;
 use std::ops::{Deref, Range};
 use std::ptr;
 use tracing::debug;
@@ -1352,18 +1353,14 @@ fn check_call<'b>(
 
         let param_tys = self.cx.func_params_types(fn_ty);
 
-        let all_args_match = param_tys
-            .iter()
-            .zip(args.iter().map(|&v| self.val_ty(v)))
+        let all_args_match = iter::zip(&param_tys, args.iter().map(|&v| self.val_ty(v)))
             .all(|(expected_ty, actual_ty)| *expected_ty == actual_ty);
 
         if all_args_match {
             return Cow::Borrowed(args);
         }
 
-        let casted_args: Vec<_> = param_tys
-            .into_iter()
-            .zip(args.iter())
+        let casted_args: Vec<_> = iter::zip(param_tys, args)
             .enumerate()
             .map(|(i, (expected_ty, &actual_val))| {
                 let actual_ty = self.val_ty(actual_val);