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};
50
50
use ptr;
51
51
use mem;
52
52
use marker:: { Copy , Send , Sync , self } ;
53
+ use iter_private:: TrustedRandomAccess ;
53
54
54
55
#[ repr( C ) ]
55
56
struct Repr < T > {
@@ -1942,3 +1943,17 @@ macro_rules! impl_marker_for {
1942
1943
1943
1944
impl_marker_for ! ( BytewiseEquality ,
1944
1945
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