mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-01 06:51:58 +00:00
drive-by: assert when iterating through InstantiatedPredicates
This commit is contained in:
parent
9b28edb6d7
commit
e1533a26f7
@ -1264,6 +1264,7 @@ impl<'tcx> IntoIterator for InstantiatedPredicates<'tcx> {
|
||||
type IntoIter = std::iter::Zip<std::vec::IntoIter<Predicate<'tcx>>, std::vec::IntoIter<Span>>;
|
||||
|
||||
fn into_iter(self) -> Self::IntoIter {
|
||||
debug_assert_eq!(self.predicates.len(), self.spans.len());
|
||||
std::iter::zip(self.predicates, self.spans)
|
||||
}
|
||||
}
|
||||
@ -1277,6 +1278,7 @@ impl<'a, 'tcx> IntoIterator for &'a InstantiatedPredicates<'tcx> {
|
||||
>;
|
||||
|
||||
fn into_iter(self) -> Self::IntoIter {
|
||||
debug_assert_eq!(self.predicates.len(), self.spans.len());
|
||||
std::iter::zip(self.predicates.iter().copied(), self.spans.iter().copied())
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user