File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -50,6 +50,7 @@ use result::Result::{Ok, Err};
5050use ptr;
5151use mem;
5252use marker:: { Copy , Send , Sync , self } ;
53+ use iter_private:: TrustedRandomAccess ;
5354
5455#[ repr( C ) ]
5556struct Repr < T > {
@@ -1942,3 +1943,17 @@ macro_rules! impl_marker_for {
19421943
19431944impl_marker_for ! ( BytewiseEquality ,
19441945 u8 i8 u16 i16 u32 i32 u64 i64 usize isize char bool ) ;
1946+
1947+ #[ doc( hidden) ]
1948+ unsafe impl < ' a , T > TrustedRandomAccess for Iter < ' a , T > {
1949+ unsafe fn get_unchecked ( & mut self , i : usize ) -> & ' a T {
1950+ & * self . ptr . offset ( i as isize )
1951+ }
1952+ }
1953+
1954+ #[ doc( hidden) ]
1955+ unsafe impl < ' a , T > TrustedRandomAccess for IterMut < ' a , T > {
1956+ unsafe fn get_unchecked ( & mut self , i : usize ) -> & ' a mut T {
1957+ & mut * self . ptr . offset ( i as isize )
1958+ }
1959+ }
You can’t perform that action at this time.
0 commit comments