diff options
| author | Michael Goulet <michael@errs.io> | 2023-01-03 03:38:06 +0000 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2023-01-15 15:36:06 +0000 |
| commit | e1533a26f77000b6e22195987ef45d0aae3c710a (patch) | |
| tree | 37ce4c3b711a937ede9ae74691adb5560888d7a2 | |
| parent | 9b28edb6d7746f457e79f5ca2c4ade944f653113 (diff) | |
| download | rust-e1533a26f77000b6e22195987ef45d0aae3c710a.tar.gz rust-e1533a26f77000b6e22195987ef45d0aae3c710a.zip | |
drive-by: assert when iterating through InstantiatedPredicates
| -rw-r--r-- | compiler/rustc_middle/src/ty/mod.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/compiler/rustc_middle/src/ty/mod.rs b/compiler/rustc_middle/src/ty/mod.rs index 655753a42ef..bf8f45c50a3 100644 --- a/compiler/rustc_middle/src/ty/mod.rs +++ b/compiler/rustc_middle/src/ty/mod.rs @@ -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()) } } |
