Rollup merge of #52858 - frewsxcv:frewsxcv-elaborator, r=SimonSapin

Implement Iterator::size_hint for Elaborator.

None
This commit is contained in:
Corey Farwell 2018-08-17 08:23:33 -07:00 committed by GitHub
commit 2578036f47
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -239,6 +239,10 @@ fn push(&mut self, predicate: &ty::Predicate<'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() {