diff --git a/compiler/rustc_middle/src/ty/subst.rs b/compiler/rustc_middle/src/ty/subst.rs index c1cf7896db59a..d8c1c63d7a30c 100644 --- a/compiler/rustc_middle/src/ty/subst.rs +++ b/compiler/rustc_middle/src/ty/subst.rs @@ -589,6 +589,10 @@ where fn next(&mut self) -> Option { Some(EarlyBinder(self.it.next()?).subst(self.tcx, self.substs)) } + + fn size_hint(&self) -> (usize, Option) { + self.it.size_hint() + } } impl<'tcx, I: IntoIterator> DoubleEndedIterator for SubstIter<'_, 'tcx, I> @@ -631,6 +635,10 @@ where fn next(&mut self) -> Option { Some(EarlyBinder(*self.it.next()?).subst(self.tcx, self.substs)) } + + fn size_hint(&self) -> (usize, Option) { + self.it.size_hint() + } } impl<'tcx, I: IntoIterator> DoubleEndedIterator for SubstIterCopied<'_, 'tcx, I> @@ -660,6 +668,10 @@ impl Iterator for EarlyBinderIter { fn next(&mut self) -> Option { self.t.next().map(|i| EarlyBinder(i)) } + + fn size_hint(&self) -> (usize, Option) { + self.t.size_hint() + } } impl<'tcx, T: TypeFoldable<'tcx>> ty::EarlyBinder {