@@ -975,22 +975,6 @@ pub trait ImmutableVector<'self, T> {
975975
976976impl < ' self , T > ImmutableVector < ' self , T > for & ' self [ T ] {
977977 #[ inline]
978- #[ cfg( stage0) ]
979- fn slice ( & self , start : uint , end : uint ) -> & ' self [ T ] {
980- assert ! ( start <= end) ;
981- assert ! ( end <= self . len( ) ) ;
982- do self. as_imm_buf |p, _len| {
983- unsafe {
984- cast:: transmute ( Slice {
985- data : ptr:: offset ( p, start as int ) ,
986- len : ( end - start) * sys:: nonzero_size_of :: < T > ( ) ,
987- } )
988- }
989- }
990- }
991-
992- #[ inline]
993- #[ cfg( not( stage0) ) ]
994978 fn slice ( & self , start : uint , end : uint ) -> & ' self [ T ] {
995979 assert ! ( start <= end) ;
996980 assert ! ( end <= self . len( ) ) ;
@@ -1149,14 +1133,6 @@ impl<'self,T> ImmutableVector<'self, T> for &'self [T] {
11491133 }
11501134
11511135 #[ inline]
1152- #[ cfg( stage0) ]
1153- fn as_imm_buf < U > ( & self , f : & fn ( * T , uint ) -> U ) -> U {
1154- let s = self . repr ( ) ;
1155- f ( s. data , s. len / sys:: nonzero_size_of :: < T > ( ) )
1156- }
1157-
1158- #[ inline]
1159- #[ cfg( not( stage0) ) ]
11601136 fn as_imm_buf < U > ( & self , f : & fn ( * T , uint ) -> U ) -> U {
11611137 let s = self . repr ( ) ;
11621138 f ( s. data , s. len )
@@ -1944,22 +1920,6 @@ pub trait MutableVector<'self, T> {
19441920
19451921impl < ' self , T > MutableVector < ' self , T > for & ' self mut [ T ] {
19461922 #[ inline]
1947- #[ cfg( stage0) ]
1948- fn mut_slice ( self , start : uint , end : uint ) -> & ' self mut [ T ] {
1949- assert ! ( start <= end) ;
1950- assert ! ( end <= self . len( ) ) ;
1951- do self. as_mut_buf |p, _len| {
1952- unsafe {
1953- cast:: transmute ( Slice {
1954- data : ptr:: mut_offset ( p, start as int ) as * T ,
1955- len : ( end - start) * sys:: nonzero_size_of :: < T > ( )
1956- } )
1957- }
1958- }
1959- }
1960-
1961- #[ inline]
1962- #[ cfg( not( stage0) ) ]
19631923 fn mut_slice ( self , start : uint , end : uint ) -> & ' self mut [ T ] {
19641924 assert ! ( start <= end) ;
19651925 assert ! ( end <= self . len( ) ) ;
@@ -2052,14 +2012,6 @@ impl<'self,T> MutableVector<'self, T> for &'self mut [T] {
20522012 }
20532013
20542014 #[ inline]
2055- #[ cfg( stage0) ]
2056- fn as_mut_buf < U > ( self , f : & fn ( * mut T , uint ) -> U ) -> U {
2057- let Slice { data, len } = self . repr ( ) ;
2058- f ( data as * mut T , len / sys:: nonzero_size_of :: < T > ( ) )
2059- }
2060-
2061- #[ inline]
2062- #[ cfg( not( stage0) ) ]
20632015 fn as_mut_buf < U > ( self , f : & fn ( * mut T , uint ) -> U ) -> U {
20642016 let Slice { data, len } = self . repr ( ) ;
20652017 f ( data as * mut T , len)
@@ -2151,22 +2103,6 @@ pub mod raw {
21512103 * not bytes).
21522104 */
21532105 #[ inline]
2154- #[ cfg( stage0) ]
2155- pub unsafe fn buf_as_slice < T , U > ( p : * T ,
2156- len : uint ,
2157- f : & fn ( v : & [ T ] ) -> U ) -> U {
2158- f ( cast:: transmute ( Slice {
2159- data : p,
2160- len : len * sys:: nonzero_size_of :: < T > ( )
2161- } ) )
2162- }
2163-
2164- /**
2165- * Form a slice from a pointer and length (as a number of units,
2166- * not bytes).
2167- */
2168- #[ inline]
2169- #[ cfg( not( stage0) ) ]
21702106 pub unsafe fn buf_as_slice < T , U > ( p : * T ,
21712107 len : uint ,
21722108 f : & fn ( v : & [ T ] ) -> U ) -> U {
@@ -2181,22 +2117,6 @@ pub mod raw {
21812117 * not bytes).
21822118 */
21832119 #[ inline]
2184- #[ cfg( stage0) ]
2185- pub unsafe fn mut_buf_as_slice < T , U > ( p : * mut T ,
2186- len : uint ,
2187- f : & fn ( v : & mut [ T ] ) -> U ) -> U {
2188- f ( cast:: transmute ( Slice {
2189- data : p as * T ,
2190- len : len * sys:: nonzero_size_of :: < T > ( )
2191- } ) )
2192- }
2193-
2194- /**
2195- * Form a slice from a pointer and length (as a number of units,
2196- * not bytes).
2197- */
2198- #[ inline]
2199- #[ cfg( not( stage0) ) ]
22002120 pub unsafe fn mut_buf_as_slice < T , U > ( p : * mut T ,
22012121 len : uint ,
22022122 f : & fn ( v : & mut [ T ] ) -> U ) -> U {
0 commit comments