about summary refs log tree commit diff
path: root/src/libcore/array.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2015-02-17 05:57:55 +0000
committerbors <bors@rust-lang.org>2015-02-17 05:57:55 +0000
commitf1bb6c2f46f08c1d7b6d695f5b3cf93142cb8860 (patch)
tree98ca2711a34754a09d5eedaa32770aed248a7dce /src/libcore/array.rs
parent22224ca4499247e99e18fba8a18a4259f0e4d08b (diff)
parent35ee89599cb50be74270e6475f4bbe182e769892 (diff)
downloadrust-f1bb6c2f46f08c1d7b6d695f5b3cf93142cb8860.tar.gz
rust-f1bb6c2f46f08c1d7b6d695f5b3cf93142cb8860.zip
Auto merge of #22397 - Manishearth:rollup, r=huonw
None
Diffstat (limited to 'src/libcore/array.rs')
-rw-r--r--src/libcore/array.rs24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/libcore/array.rs b/src/libcore/array.rs
index a596fe4a588..abaa7594d04 100644
--- a/src/libcore/array.rs
+++ b/src/libcore/array.rs
@@ -48,6 +48,8 @@ macro_rules! array_impls {
                 }
             }
 
+            // NOTE(stage0): remove impl after a snapshot
+            #[cfg(stage0)]
             impl<'a, T> IntoIterator for &'a [T; $N] {
                 type IntoIter = Iter<'a, T>;
 
@@ -56,7 +58,29 @@ macro_rules! array_impls {
                 }
             }
 
+            #[cfg(not(stage0))]  // NOTE(stage0): remove cfg after a snapshot
+            impl<'a, T> IntoIterator for &'a [T; $N] {
+                type Item = &'a T;
+                type IntoIter = Iter<'a, T>;
+
+                fn into_iter(self) -> Iter<'a, T> {
+                    self.iter()
+                }
+            }
+
+            // NOTE(stage0): remove impl after a snapshot
+            #[cfg(stage0)]
+            impl<'a, T> IntoIterator for &'a mut [T; $N] {
+                type IntoIter = IterMut<'a, T>;
+
+                fn into_iter(self) -> IterMut<'a, T> {
+                    self.iter_mut()
+                }
+            }
+
+            #[cfg(not(stage0))]  // NOTE(stage0): remove cfg after a snapshot
             impl<'a, T> IntoIterator for &'a mut [T; $N] {
+                type Item = &'a mut T;
                 type IntoIter = IterMut<'a, T>;
 
                 fn into_iter(self) -> IterMut<'a, T> {