@@ -44,6 +44,10 @@ use iter::*;
4444use marker:: Copy ;
4545use num:: Int ;
4646use ops:: { FnMut , self , Index } ;
47+ #[ cfg( stage0) ]
48+ use ops:: FullRange as RangeFull ;
49+ #[ cfg( not( stage0) ) ]
50+ use ops:: RangeFull ;
4751use option:: Option ;
4852use option:: Option :: { None , Some } ;
4953use result:: Result ;
@@ -543,10 +547,10 @@ impl<T> ops::Index<ops::RangeFrom<uint>> for [T] {
543547 }
544548}
545549#[ stable( feature = "rust1" , since = "1.0.0" ) ]
546- impl < T > ops:: Index < ops :: FullRange > for [ T ] {
550+ impl < T > ops:: Index < RangeFull > for [ T ] {
547551 type Output = [ T ] ;
548552 #[ inline]
549- fn index ( & self , _index : & ops :: FullRange ) -> & [ T ] {
553+ fn index ( & self , _index : & RangeFull ) -> & [ T ] {
550554 self
551555 }
552556}
@@ -584,10 +588,10 @@ impl<T> ops::IndexMut<ops::RangeFrom<uint>> for [T] {
584588 }
585589}
586590#[ stable( feature = "rust1" , since = "1.0.0" ) ]
587- impl < T > ops:: IndexMut < ops :: FullRange > for [ T ] {
591+ impl < T > ops:: IndexMut < RangeFull > for [ T ] {
588592 type Output = [ T ] ;
589593 #[ inline]
590- fn index_mut ( & mut self , _index : & ops :: FullRange ) -> & mut [ T ] {
594+ fn index_mut ( & mut self , _index : & RangeFull ) -> & mut [ T ] {
591595 self
592596 }
593597}
@@ -750,6 +754,7 @@ impl<'a, T> ops::Index<ops::RangeFrom<uint>> for Iter<'a, T> {
750754 }
751755}
752756
757+ #[ cfg( stage0) ]
753758#[ unstable( feature = "core" ) ]
754759impl < ' a , T > ops:: Index < ops:: FullRange > for Iter < ' a , T > {
755760 type Output = [ T ] ;
@@ -758,6 +763,15 @@ impl<'a, T> ops::Index<ops::FullRange> for Iter<'a, T> {
758763 self . as_slice ( )
759764 }
760765}
766+ #[ cfg( not( stage0) ) ]
767+ #[ unstable( feature = "core" ) ]
768+ impl < ' a , T > ops:: Index < RangeFull > for Iter < ' a , T > {
769+ type Output = [ T ] ;
770+ #[ inline]
771+ fn index ( & self , _index : & RangeFull ) -> & [ T ] {
772+ self . as_slice ( )
773+ }
774+ }
761775
762776impl < ' a , T > Iter < ' a , T > {
763777 /// View the underlying data as a subslice of the original data.
@@ -821,30 +835,30 @@ impl<'a, T> ops::Index<ops::Range<uint>> for IterMut<'a, T> {
821835 type Output = [ T ] ;
822836 #[ inline]
823837 fn index ( & self , index : & ops:: Range < uint > ) -> & [ T ] {
824- self . index ( & ops :: FullRange ) . index ( index)
838+ self . index ( & RangeFull ) . index ( index)
825839 }
826840}
827841#[ unstable( feature = "core" ) ]
828842impl < ' a , T > ops:: Index < ops:: RangeTo < uint > > for IterMut < ' a , T > {
829843 type Output = [ T ] ;
830844 #[ inline]
831845 fn index ( & self , index : & ops:: RangeTo < uint > ) -> & [ T ] {
832- self . index ( & ops :: FullRange ) . index ( index)
846+ self . index ( & RangeFull ) . index ( index)
833847 }
834848}
835849#[ unstable( feature = "core" ) ]
836850impl < ' a , T > ops:: Index < ops:: RangeFrom < uint > > for IterMut < ' a , T > {
837851 type Output = [ T ] ;
838852 #[ inline]
839853 fn index ( & self , index : & ops:: RangeFrom < uint > ) -> & [ T ] {
840- self . index ( & ops :: FullRange ) . index ( index)
854+ self . index ( & RangeFull ) . index ( index)
841855 }
842856}
843857#[ unstable( feature = "core" ) ]
844- impl < ' a , T > ops:: Index < ops :: FullRange > for IterMut < ' a , T > {
858+ impl < ' a , T > ops:: Index < RangeFull > for IterMut < ' a , T > {
845859 type Output = [ T ] ;
846860 #[ inline]
847- fn index ( & self , _index : & ops :: FullRange ) -> & [ T ] {
861+ fn index ( & self , _index : & RangeFull ) -> & [ T ] {
848862 make_slice ! ( T => & [ T ] : self . ptr, self . end)
849863 }
850864}
@@ -854,30 +868,30 @@ impl<'a, T> ops::IndexMut<ops::Range<uint>> for IterMut<'a, T> {
854868 type Output = [ T ] ;
855869 #[ inline]
856870 fn index_mut ( & mut self , index : & ops:: Range < uint > ) -> & mut [ T ] {
857- self . index_mut ( & ops :: FullRange ) . index_mut ( index)
871+ self . index_mut ( & RangeFull ) . index_mut ( index)
858872 }
859873}
860874#[ unstable( feature = "core" ) ]
861875impl < ' a , T > ops:: IndexMut < ops:: RangeTo < uint > > for IterMut < ' a , T > {
862876 type Output = [ T ] ;
863877 #[ inline]
864878 fn index_mut ( & mut self , index : & ops:: RangeTo < uint > ) -> & mut [ T ] {
865- self . index_mut ( & ops :: FullRange ) . index_mut ( index)
879+ self . index_mut ( & RangeFull ) . index_mut ( index)
866880 }
867881}
868882#[ unstable( feature = "core" ) ]
869883impl < ' a , T > ops:: IndexMut < ops:: RangeFrom < uint > > for IterMut < ' a , T > {
870884 type Output = [ T ] ;
871885 #[ inline]
872886 fn index_mut ( & mut self , index : & ops:: RangeFrom < uint > ) -> & mut [ T ] {
873- self . index_mut ( & ops :: FullRange ) . index_mut ( index)
887+ self . index_mut ( & RangeFull ) . index_mut ( index)
874888 }
875889}
876890#[ unstable( feature = "core" ) ]
877- impl < ' a , T > ops:: IndexMut < ops :: FullRange > for IterMut < ' a , T > {
891+ impl < ' a , T > ops:: IndexMut < RangeFull > for IterMut < ' a , T > {
878892 type Output = [ T ] ;
879893 #[ inline]
880- fn index_mut ( & mut self , _index : & ops :: FullRange ) -> & mut [ T ] {
894+ fn index_mut ( & mut self , _index : & RangeFull ) -> & mut [ T ] {
881895 make_slice ! ( T => & mut [ T ] : self . ptr, self . end)
882896 }
883897}
0 commit comments