@@ -1357,7 +1357,7 @@ pub pure fn each<T>(v: &r/[T], f: &fn(&r/T) -> bool) {
13571357/// a vector with mutable contents and you would like
13581358/// to mutate the contents as you iterate.
13591359#[ inline( always) ]
1360- pub fn each_mut < T > ( v : & mut [ T ] , f : & fn ( elem : & mut T ) -> bool ) {
1360+ pub fn each_mut < T > ( v : & ' r mut [ T ] , f : & fn ( elem : & ' r mut T ) -> bool ) {
13611361 let mut i = 0 ;
13621362 let n = v. len ( ) ;
13631363 while i < n {
@@ -2280,11 +2280,9 @@ pub mod bytes {
22802280// ___________________________________________________________________________
22812281// ITERATION TRAIT METHODS
22822282
2283- impl < A > iter:: BaseIter < A > for & self / [ A ] {
2283+ impl < A > iter:: BaseIter < A > for & ' self [ A ] {
22842284 #[ inline( always) ]
2285- pub pure fn each ( & self , blk : & fn ( v : & ' self A ) -> bool ) {
2286- each ( * self , blk)
2287- }
2285+ pure fn each ( & self , blk : & fn ( v : & ' self A ) -> bool ) { each ( * self , blk) }
22882286 #[ inline( always) ]
22892287 pure fn size_hint ( & self ) -> Option < uint > { Some ( self . len ( ) ) }
22902288}
@@ -2305,6 +2303,29 @@ impl<A> iter::BaseIter<A> for @[A] {
23052303 pure fn size_hint ( & self ) -> Option < uint > { Some ( self . len ( ) ) }
23062304}
23072305
2306+ impl < A > iter:: MutableIter < A > for & ' self mut [ A ] {
2307+ #[ inline( always) ]
2308+ fn each_mut ( & mut self , blk : & fn ( v : & ' self mut A ) -> bool ) {
2309+ each_mut ( * self , blk)
2310+ }
2311+ }
2312+
2313+ // FIXME(#4148): This should be redundant
2314+ impl < A > iter:: MutableIter < A > for ~[ A ] {
2315+ #[ inline( always) ]
2316+ fn each_mut ( & mut self , blk : & fn ( v : & ' self mut A ) -> bool ) {
2317+ each_mut ( * self , blk)
2318+ }
2319+ }
2320+
2321+ // FIXME(#4148): This should be redundant
2322+ impl < A > iter:: MutableIter < A > for @mut [ A ] {
2323+ #[ inline( always) ]
2324+ fn each_mut ( & mut self , blk : & fn ( v : & mut A ) -> bool ) {
2325+ each_mut ( * self , blk)
2326+ }
2327+ }
2328+
23082329impl < A > iter:: ExtendedIter < A > for & self /[ A ] {
23092330 pub pure fn eachi ( & self , blk : & fn ( uint , v : & A ) -> bool ) {
23102331 iter:: eachi ( self , blk)
0 commit comments