Skip to content

Commit 91569a9

Browse files
committed
Rollup merge of rust-lang#22795 - alexcrichton:issue-22617, r=huonw
Keeps the method consistent with `Iterator::any`. Closes rust-lang#22617 [breaking-change]
2 parents fb92e31 + 18878b1 commit 91569a9

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/libcore/iter.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -637,8 +637,8 @@ pub trait IteratorExt: Iterator + Sized {
637637
/// ```
638638
#[inline]
639639
#[stable(feature = "rust1", since = "1.0.0")]
640-
fn all<F>(self, mut f: F) -> bool where F: FnMut(Self::Item) -> bool {
641-
for x in self { if !f(x) { return false; } }
640+
fn all<F>(&mut self, mut f: F) -> bool where F: FnMut(Self::Item) -> bool {
641+
for x in self.by_ref() { if !f(x) { return false; } }
642642
true
643643
}
644644

src/librustc/middle/ty.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3896,7 +3896,7 @@ pub fn is_type_representable<'tcx>(cx: &ctxt<'tcx>, sp: Span, ty: Ty<'tcx>)
38963896
let types_a = substs_a.types.get_slice(subst::TypeSpace);
38973897
let types_b = substs_b.types.get_slice(subst::TypeSpace);
38983898

3899-
let pairs = types_a.iter().zip(types_b.iter());
3899+
let mut pairs = types_a.iter().zip(types_b.iter());
39003900

39013901
pairs.all(|(&a, &b)| same_type(a, b))
39023902
}

0 commit comments

Comments
 (0)