@@ -1357,7 +1357,7 @@ pub pure fn each<T>(v: &r/[T], f: &fn(&r/T) -> bool) {
1357
1357
/// a vector with mutable contents and you would like
1358
1358
/// to mutate the contents as you iterate.
1359
1359
#[ 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 ) {
1361
1361
let mut i = 0 ;
1362
1362
let n = v. len ( ) ;
1363
1363
while i < n {
@@ -2280,11 +2280,9 @@ pub mod bytes {
2280
2280
// ___________________________________________________________________________
2281
2281
// ITERATION TRAIT METHODS
2282
2282
2283
- impl < A > iter:: BaseIter < A > for & self / [ A ] {
2283
+ impl < A > iter:: BaseIter < A > for & ' self [ A ] {
2284
2284
#[ 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) }
2288
2286
#[ inline( always) ]
2289
2287
pure fn size_hint ( & self ) -> Option < uint > { Some ( self . len ( ) ) }
2290
2288
}
@@ -2305,6 +2303,29 @@ impl<A> iter::BaseIter<A> for @[A] {
2305
2303
pure fn size_hint ( & self ) -> Option < uint > { Some ( self . len ( ) ) }
2306
2304
}
2307
2305
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
+
2308
2329
impl < A > iter:: ExtendedIter < A > for & self /[ A ] {
2309
2330
pub pure fn eachi ( & self , blk : & fn ( uint , v : & A ) -> bool ) {
2310
2331
iter:: eachi ( self , blk)
0 commit comments