Skip to content

Commit 742ef58

Browse files
committed
Implement Iterator::size_hint for Elaborator.
1 parent 5050349 commit 742ef58

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/librustc/traits/util.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,10 @@ impl<'cx, 'gcx, 'tcx> Elaborator<'cx, 'gcx, 'tcx> {
239239
impl<'cx, 'gcx, 'tcx> Iterator for Elaborator<'cx, 'gcx, 'tcx> {
240240
type Item = ty::Predicate<'tcx>;
241241

242+
fn size_hint(&self) -> (usize, Option<usize>) {
243+
(self.stack.len(), None)
244+
}
245+
242246
fn next(&mut self) -> Option<ty::Predicate<'tcx>> {
243247
// Extract next item from top-most stack frame, if any.
244248
let next_predicate = match self.stack.pop() {

0 commit comments

Comments
 (0)