Skip to content

Commit 3c30ff2

Browse files
committed
---
yaml --- r: 63089 b: refs/heads/snap-stage3 c: 07e4d69 h: refs/heads/master i: 63087: 5a0f3fb v: v3
1 parent c0a040b commit 3c30ff2

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 2d28d645422c1617be58c8ca7ad9a457264ca850
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: d945543ebf446913a44375169aa23686ffaa6205
4+
refs/heads/snap-stage3: 07e4d69baa5b1bd3d4cc4a6c9e17c90168d6f058
55
refs/heads/try: 7b78b52e602bb3ea8174f9b2006bff3315f03ef9
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/src/libstd/iterator.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,8 @@ pub trait IteratorUtil<A> {
285285
/// let a = [1, 2, 3, 4, 5];
286286
/// assert!(a.iter().last().get() == &5);
287287
/// ~~~
288-
fn last(&mut self) -> Option<A>;
288+
// FIXME: #5898: should be called `last`
289+
fn last_(&mut self) -> Option<A>;
289290

290291
/// Performs a fold operation over the entire iterator, returning the
291292
/// eventual state at the end of the iteration.
@@ -437,7 +438,7 @@ impl<A, T: Iterator<A>> IteratorUtil<A> for T {
437438

438439
/// Return the last item yielded by an iterator.
439440
#[inline(always)]
440-
fn last(&mut self) -> Option<A> {
441+
fn last_(&mut self) -> Option<A> {
441442
let mut last = None;
442443
for self.advance |x| { last = Some(x); }
443444
last
@@ -1025,8 +1026,8 @@ mod tests {
10251026
#[test]
10261027
fn test_iterator_last() {
10271028
let v = &[0, 1, 2, 3, 4];
1028-
assert_eq!(v.iter().last().unwrap(), &4);
1029-
assert_eq!(v.slice(0, 1).iter().last().unwrap(), &0);
1029+
assert_eq!(v.iter().last_().unwrap(), &4);
1030+
assert_eq!(v.slice(0, 1).iter().last_().unwrap(), &0);
10301031
}
10311032

10321033
#[test]

0 commit comments

Comments
 (0)