diff options
Diffstat (limited to 'src/libsyntax/opt_vec.rs')
| -rw-r--r-- | src/libsyntax/opt_vec.rs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/libsyntax/opt_vec.rs b/src/libsyntax/opt_vec.rs index 600ab964e52..6110579863d 100644 --- a/src/libsyntax/opt_vec.rs +++ b/src/libsyntax/opt_vec.rs @@ -132,12 +132,20 @@ impl<A:Eq> Eq for OptVec<A> { } impl<A> BaseIter<A> for OptVec<A> { + #[cfg(stage0)] fn each(&self, blk: &fn(v: &A) -> bool) { match *self { Empty => {} Vec(ref v) => v.each(blk) } } + #[cfg(not(stage0))] + fn each(&self, blk: &fn(v: &A) -> bool) -> bool { + match *self { + Empty => true, + Vec(ref v) => v.each(blk) + } + } fn size_hint(&self) -> Option<uint> { Some(self.len()) @@ -146,10 +154,16 @@ impl<A> BaseIter<A> for OptVec<A> { impl<A> old_iter::ExtendedIter<A> for OptVec<A> { #[inline(always)] + #[cfg(stage0)] fn eachi(&self, blk: &fn(v: uint, v: &A) -> bool) { old_iter::eachi(self, blk) } #[inline(always)] + #[cfg(not(stage0))] + fn eachi(&self, blk: &fn(v: uint, v: &A) -> bool) -> bool { + old_iter::eachi(self, blk) + } + #[inline(always)] fn all(&self, blk: &fn(&A) -> bool) -> bool { old_iter::all(self, blk) } |
