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:
commit
91569a95f1
2 changed files with 3 additions and 3 deletions
|
@ -637,8 +637,8 @@ pub trait IteratorExt: Iterator + Sized {
|
||||||
/// ```
|
/// ```
|
||||||
#[inline]
|
#[inline]
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
fn all<F>(self, mut f: F) -> bool where F: FnMut(Self::Item) -> bool {
|
fn all<F>(&mut self, mut f: F) -> bool where F: FnMut(Self::Item) -> bool {
|
||||||
for x in self { if !f(x) { return false; } }
|
for x in self.by_ref() { if !f(x) { return false; } }
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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_a = substs_a.types.get_slice(subst::TypeSpace);
|
||||||
let types_b = substs_b.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))
|
pairs.all(|(&a, &b)| same_type(a, b))
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue