@@ -946,10 +946,7 @@ mod _casts {
946946 pub unsafe fn cast_unsized < U : ' a + ?Sized , F : FnOnce ( * mut T ) -> * mut U > (
947947 self ,
948948 cast : F ,
949- ) -> Ptr < ' a , U , ( I :: Aliasing , invariant:: Any , invariant:: Any ) >
950- where
951- U : ' a ,
952- {
949+ ) -> Ptr < ' a , U , ( I :: Aliasing , invariant:: Any , invariant:: Any ) > {
953950 let ptr = cast ( self . as_non_null ( ) . as_ptr ( ) ) ;
954951
955952 // SAFETY: Caller promises that `cast` is just a cast. We call
@@ -1114,12 +1111,10 @@ mod _casts {
11141111 /// # Panics
11151112 ///
11161113 /// Panics if `U` is a DST whose trailing slice element is zero-sized.
1117- pub ( crate ) fn try_cast_into < U : ' a + ?Sized + KnownLayout > (
1114+ pub ( crate ) fn try_cast_into < U : ' a + ?Sized + KnownLayout + NoCell > (
11181115 & self ,
11191116 cast_type : CastType ,
11201117 ) -> Option < ( Ptr < ' a , U , ( I :: Aliasing , invariant:: Aligned , invariant:: Initialized ) > , usize ) >
1121- where
1122- U : NoCell ,
11231118 {
11241119 // PANICS: By invariant, the byte range addressed by `self.ptr` does
11251120 // not wrap around the address space. This implies that the sum of
@@ -1215,12 +1210,9 @@ mod _casts {
12151210 /// references the same byte range as `self`.
12161211 #[ allow( unused) ]
12171212 #[ inline( always) ]
1218- pub ( crate ) fn try_cast_into_no_leftover < U : ' a + ?Sized + KnownLayout > (
1213+ pub ( crate ) fn try_cast_into_no_leftover < U : ' a + ?Sized + KnownLayout + NoCell > (
12191214 & self ,
1220- ) -> Option < Ptr < ' a , U , ( I :: Aliasing , invariant:: Aligned , invariant:: Initialized ) > >
1221- where
1222- U : NoCell ,
1223- {
1215+ ) -> Option < Ptr < ' a , U , ( I :: Aliasing , invariant:: Aligned , invariant:: Initialized ) > > {
12241216 // TODO(#67): Remove this allow. See NonNulSlicelExt for more
12251217 // details.
12261218 #[ allow( unstable_name_collisions) ]
0 commit comments