Skip to content

Commit 68a0b6a

Browse files
committed
---
yaml --- r: 212928 b: refs/heads/master c: f9b70ac h: refs/heads/master v: v3
1 parent 9e8113c commit 68a0b6a

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 032804bf68e2ac13add895206f2173409acff836
2+
refs/heads/master: f9b70acfd4167f5911c1be4e2dc960c370adb266
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: ba0e1cd8147d452c356aacb29fb87568ca26f111
55
refs/heads/try: 1864973ae17213c5a58c4dd3f9af6d1b6c7d2e05

trunk/src/libcollections/vec.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1429,7 +1429,7 @@ impl<T> FromIterator<T> for Vec<T> {
14291429
vector
14301430
}
14311431
};
1432-
vector.extend(iterable);
1432+
vector.extend_desugared(iterator);
14331433
vector
14341434
}
14351435
}
@@ -1466,9 +1466,14 @@ impl<'a, T> IntoIterator for &'a mut Vec<T> {
14661466

14671467
#[unstable(feature = "collections", reason = "waiting on Extend stability")]
14681468
impl<T> Extend<T> for Vec<T> {
1469+
#[inline]
14691470
fn extend<I: IntoIterator<Item=T>>(&mut self, iterable: I) {
1470-
let mut iterator = iterable.into_iter();
1471+
self.extend_desugared(iterable.into_iter())
1472+
}
1473+
}
14711474

1475+
impl<T> Vec<T> {
1476+
fn extend_desugared<I: Iterator<Item=T>>(&mut self, mut iterator: I) {
14721477
// This function should be the moral equivalent of:
14731478
//
14741479
// for item in iterator {

0 commit comments

Comments
 (0)