Skip to content

Commit

Permalink
Rollup merge of rust-lang#52858 - frewsxcv:frewsxcv-elaborator, r=Sim…
Browse files Browse the repository at this point in the history
…onSapin

Implement Iterator::size_hint for Elaborator.

None
  • Loading branch information
frewsxcv authored Aug 17, 2018
2 parents 8b923a1 + 742ef58 commit 2578036
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/librustc/traits/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,10 @@ impl<'cx, 'gcx, 'tcx> Elaborator<'cx, 'gcx, 'tcx> {
impl<'cx, 'gcx, 'tcx> Iterator for Elaborator<'cx, 'gcx, 'tcx> {
type Item = ty::Predicate<'tcx>;

fn size_hint(&self) -> (usize, Option<usize>) {
(self.stack.len(), None)
}

fn next(&mut self) -> Option<ty::Predicate<'tcx>> {
// Extract next item from top-most stack frame, if any.
let next_predicate = match self.stack.pop() {
Expand Down

0 comments on commit 2578036

Please sign in to comment.