Use iter::zip in compiler/

This commit is contained in:
Josh Stone 2021-03-08 15:32:41 -08:00
parent 3b1f5e3462
commit 72ebebe474
87 changed files with 213 additions and 204 deletions

View file

@ -116,6 +116,8 @@ use rustc_span::{symbol::MacroRulesNormalizedIdent, MultiSpan, Span};
use smallvec::SmallVec;
use std::iter;
/// Stack represented as linked list.
///
/// Those are used for environments because they grow incrementally and are not mutable.
@ -204,7 +206,7 @@ pub(super) fn check_meta_variables(
sess.span_diagnostic.span_bug(span, "length mismatch between LHSes and RHSes")
}
let mut valid = true;
for (lhs, rhs) in lhses.iter().zip(rhses.iter()) {
for (lhs, rhs) in iter::zip(lhses, rhses) {
let mut binders = Binders::default();
check_binders(sess, node_id, lhs, &Stack::Empty, &mut binders, &Stack::Empty, &mut valid);
check_occurrences(sess, node_id, rhs, &Stack::Empty, &binders, &Stack::Empty, &mut valid);