about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2013-11-09 08:36:09 -0800
committerbors <bors@rust-lang.org>2013-11-09 08:36:09 -0800
commit8379890c05b20e97fcc73c1865b8b3787caecc9f (patch)
tree7e5bc81204faeedbe059224616a837e8378ab5a5 /src/libstd
parentdc5d9b908f776bd2a18a8b30f558b6c1cc3f779d (diff)
parentf6e8d49a1a3cd67933c7efebfe7a0c55470049f3 (diff)
downloadrust-8379890c05b20e97fcc73c1865b8b3787caecc9f.tar.gz
rust-8379890c05b20e97fcc73c1865b8b3787caecc9f.zip
auto merge of #10153 : nikomatsakis/rust/issue-4846-multiple-lifetime-parameters-7, r=pnkfelix
Fully support multiple lifetime parameters on types and elsewhere, removing special treatment for `'self`. I am submitting this a touch early in that I plan to push a new commit with more tests specifically targeting types with multiple lifetime parameters -- but the current code bootstraps and passes `make check`.

Fixes #4846
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/at_vec.rs13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/libstd/at_vec.rs b/src/libstd/at_vec.rs
index 7d10061e812..90729966c18 100644
--- a/src/libstd/at_vec.rs
+++ b/src/libstd/at_vec.rs
@@ -12,7 +12,7 @@
 
 use clone::Clone;
 use container::Container;
-use iter::Iterator;
+use iter::{Iterator, FromIterator};
 use option::{Option, Some, None};
 use mem;
 use unstable::raw::Repr;
@@ -134,6 +134,17 @@ impl<T> Clone for @[T] {
     }
 }
 
+impl<A> FromIterator<A> for @[A] {
+    fn from_iterator<T: Iterator<A>>(iterator: &mut T) -> @[A] {
+        let (lower, _) = iterator.size_hint();
+        do build(Some(lower)) |push| {
+            for x in *iterator {
+                push(x);
+            }
+        }
+    }
+}
+
 #[cfg(not(test))]
 #[allow(missing_doc)]
 pub mod traits {