@@ -1900,6 +1900,22 @@ unsafe impl<T: ?Sized> IsZero for Option<Box<T>> {
1900
1900
// Common trait implementations for Vec
1901
1901
////////////////////////////////////////////////////////////////////////////////
1902
1902
1903
+ #[ stable( feature = "rust1" , since = "1.0.0" ) ]
1904
+ impl < T > ops:: Deref for Vec < T > {
1905
+ type Target = [ T ] ;
1906
+
1907
+ fn deref ( & self ) -> & [ T ] {
1908
+ unsafe { slice:: from_raw_parts ( self . as_ptr ( ) , self . len ) }
1909
+ }
1910
+ }
1911
+
1912
+ #[ stable( feature = "rust1" , since = "1.0.0" ) ]
1913
+ impl < T > ops:: DerefMut for Vec < T > {
1914
+ fn deref_mut ( & mut self ) -> & mut [ T ] {
1915
+ unsafe { slice:: from_raw_parts_mut ( self . as_mut_ptr ( ) , self . len ) }
1916
+ }
1917
+ }
1918
+
1903
1919
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1904
1920
impl < T : Clone > Clone for Vec < T > {
1905
1921
#[ cfg( not( test) ) ]
@@ -1955,22 +1971,6 @@ impl<T, I: SliceIndex<[T]>> IndexMut<I> for Vec<T> {
1955
1971
}
1956
1972
}
1957
1973
1958
- #[ stable( feature = "rust1" , since = "1.0.0" ) ]
1959
- impl < T > ops:: Deref for Vec < T > {
1960
- type Target = [ T ] ;
1961
-
1962
- fn deref ( & self ) -> & [ T ] {
1963
- unsafe { slice:: from_raw_parts ( self . as_ptr ( ) , self . len ) }
1964
- }
1965
- }
1966
-
1967
- #[ stable( feature = "rust1" , since = "1.0.0" ) ]
1968
- impl < T > ops:: DerefMut for Vec < T > {
1969
- fn deref_mut ( & mut self ) -> & mut [ T ] {
1970
- unsafe { slice:: from_raw_parts_mut ( self . as_mut_ptr ( ) , self . len ) }
1971
- }
1972
- }
1973
-
1974
1974
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1975
1975
impl < T > FromIterator < T > for Vec < T > {
1976
1976
#[ inline]
0 commit comments