diff options
| author | Dániel Buga <bugadani@gmail.com> | 2020-10-18 10:43:01 +0200 |
|---|---|---|
| committer | Dániel Buga <bugadani@gmail.com> | 2020-10-18 11:01:08 +0200 |
| commit | f3a0f68453ee695495d88db2d3de3aadedaac3d9 (patch) | |
| tree | 4bdacdbcbffca2a6fc9cb3c240eb6918d6103007 | |
| parent | d708d7fb7922215310396d29b00ae4bfcb992a0f (diff) | |
| download | rust-f3a0f68453ee695495d88db2d3de3aadedaac3d9.tar.gz rust-f3a0f68453ee695495d88db2d3de3aadedaac3d9.zip | |
Zip -> Enumerate
| -rw-r--r-- | compiler/rustc_mir/src/borrow_check/type_check/input_output.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/rustc_mir/src/borrow_check/type_check/input_output.rs b/compiler/rustc_mir/src/borrow_check/type_check/input_output.rs index 3c8cbeeca38..444f9fe8d0a 100644 --- a/compiler/rustc_mir/src/borrow_check/type_check/input_output.rs +++ b/compiler/rustc_mir/src/borrow_check/type_check/input_output.rs @@ -73,7 +73,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> { ); // Equate expected input tys with those in the MIR. - for (&normalized_input_ty, argument_index) in normalized_input_tys.iter().zip(0..) { + for (argument_index, &normalized_input_ty) in normalized_input_tys.iter().enumerate() { // In MIR, argument N is stored in local N+1. let local = Local::new(argument_index + 1); @@ -87,8 +87,8 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> { } if let Some(user_provided_sig) = user_provided_sig { - for (&user_provided_input_ty, argument_index) in - user_provided_sig.inputs().iter().zip(0..) + for (argument_index, &user_provided_input_ty) in + user_provided_sig.inputs().iter().enumerate() { // In MIR, closures begin an implicit `self`, so // argument N is stored in local N+2. |
