Rollup merge of #22795 - alexcrichton:issue-22617, r=huonw

Keeps the method consistent with `Iterator::any`.

Closes #22617
[breaking-change]
This commit is contained in:
Manish Goregaokar 2015-02-27 11:43:57 +05:30
commit 91569a95f1
2 changed files with 3 additions and 3 deletions

View file

@ -637,8 +637,8 @@ pub trait IteratorExt: Iterator + Sized {
/// ```
#[inline]
#[stable(feature = "rust1", since = "1.0.0")]
fn all<F>(self, mut f: F) -> bool where F: FnMut(Self::Item) -> bool {
for x in self { if !f(x) { return false; } }
fn all<F>(&mut self, mut f: F) -> bool where F: FnMut(Self::Item) -> bool {
for x in self.by_ref() { if !f(x) { return false; } }
true
}

View file

@ -3896,7 +3896,7 @@ pub fn is_type_representable<'tcx>(cx: &ctxt<'tcx>, sp: Span, ty: Ty<'tcx>)
let types_a = substs_a.types.get_slice(subst::TypeSpace);
let types_b = substs_b.types.get_slice(subst::TypeSpace);
let pairs = types_a.iter().zip(types_b.iter());
let mut pairs = types_a.iter().zip(types_b.iter());
pairs.all(|(&a, &b)| same_type(a, b))
}