@@ -1164,38 +1164,6 @@ mod _casts {
11641164mod _project {
11651165 use super :: * ;
11661166
1167- impl < ' a , T , I > Ptr < ' a , T , I >
1168- where
1169- T : ' a + ?Sized ,
1170- I : Invariants < Validity = Initialized > ,
1171- {
1172- /// Projects a field from `self`.
1173- ///
1174- /// # Safety
1175- ///
1176- /// `project` has the same safety preconditions as
1177- /// `cast_unsized_unchecked`.
1178- #[ doc( hidden) ]
1179- #[ inline]
1180- pub unsafe fn project < U : ' a + ?Sized > (
1181- self ,
1182- projector : impl FnOnce ( * mut T ) -> * mut U ,
1183- ) -> Ptr < ' a , U , ( I :: Aliasing , Unaligned , Initialized ) > {
1184- // TODO(#1122): If `cast_unsized` were able to reason that, when
1185- // casting from an `Initialized` pointer, the result is another
1186- // `Initialized` pointer, we could remove this method entirely.
1187-
1188- // SAFETY: This method has the same safety preconditions as
1189- // `cast_unsized_unchecked`.
1190- let ptr = unsafe { self . cast_unsized_unchecked ( projector) } ;
1191-
1192- // SAFETY: If all of the bytes of `self` are initialized (as
1193- // promised by `I: Invariants<Validity = Initialized>`), then any
1194- // subset of those bytes are also all initialized.
1195- unsafe { ptr. assume_validity :: < Initialized > ( ) }
1196- }
1197- }
1198-
11991167 impl < ' a , T , I > Ptr < ' a , [ T ] , I >
12001168 where
12011169 T : ' a ,
0 commit comments