@@ -676,8 +676,8 @@ mod _transitions {
676676 #[ doc( hidden) ]
677677 #[ must_use]
678678 #[ inline]
679- pub const fn forget_aligned ( self ) -> Ptr < ' a , T , I :: WithAlignment < Any > > {
680- // SAFETY: `Any ` is less restrictive than `Aligned`.
679+ pub const fn forget_aligned ( self ) -> Ptr < ' a , T , I :: WithAlignment < Unknown > > {
680+ // SAFETY: `Unknown ` is less restrictive than `Aligned`.
681681 unsafe { self . assume_invariants ( ) }
682682 }
683683 }
@@ -706,15 +706,14 @@ mod _casts {
706706 /// following properties:
707707 /// - `u` addresses a subset of the bytes addressed by `p`
708708 /// - `u` has the same provenance as `p`
709- /// - If `I::Aliasing` is [`Any`] or [`Shared`], `UnsafeCell`s in `*u`
710- /// must exist at ranges identical to those at which `UnsafeCell`s
711- /// exist in `*p`
709+ /// - If `I::Aliasing` is [`Shared`], `UnsafeCell`s in `*u` must exist
710+ /// at ranges identical to those at which `UnsafeCell`s exist in `*p`
712711 #[ doc( hidden) ]
713712 #[ inline]
714713 pub unsafe fn cast_unsized_unchecked < U : ' a + ?Sized , F : FnOnce ( * mut T ) -> * mut U > (
715714 self ,
716715 cast : F ,
717- ) -> Ptr < ' a , U , ( I :: Aliasing , Any , Any ) > {
716+ ) -> Ptr < ' a , U , ( I :: Aliasing , Unknown , Unknown ) > {
718717 let ptr = cast ( self . as_inner ( ) . as_non_null ( ) . as_ptr ( ) ) ;
719718
720719 // SAFETY: Caller promises that `cast` returns a pointer whose
@@ -768,9 +767,11 @@ mod _casts {
768767 // pointer will permit mutation of this byte during `'a`, by
769768 // invariant on `self`, no other code assumes that this will
770769 // not happen.
770+ // - `Inaccessible`: There are no restrictions we need to uphold.
771771 // 7. `ptr`, trivially, conforms to the alignment invariant of
772- // `Any`.
773- // 8. `ptr`, trivially, conforms to the validity invariant of `Any`.
772+ // `Unknown`.
773+ // 8. `ptr`, trivially, conforms to the validity invariant of
774+ // `Unknown`.
774775 unsafe { Ptr :: new ( ptr) }
775776 }
776777
@@ -784,7 +785,10 @@ mod _casts {
784785 /// - `u` has the same provenance as `p`
785786 #[ doc( hidden) ]
786787 #[ inline]
787- pub unsafe fn cast_unsized < U , F , R , S > ( self , cast : F ) -> Ptr < ' a , U , ( I :: Aliasing , Any , Any ) >
788+ pub unsafe fn cast_unsized < U , F , R , S > (
789+ self ,
790+ cast : F ,
791+ ) -> Ptr < ' a , U , ( I :: Aliasing , Unknown , Unknown ) >
788792 where
789793 T : Read < I :: Aliasing , R > ,
790794 U : ' a + ?Sized + Read < I :: Aliasing , S > ,
@@ -927,10 +931,11 @@ mod _casts {
927931 // 0. Since `U: Read<I::Aliasing, _>`, either:
928932 // - `I::Aliasing` is `Exclusive`, in which case both `src` and
929933 // `ptr` conform to `Exclusive`
930- // - `I::Aliasing` is `Shared` or `Any` and `U` is `Immutable`
931- // (we already know that `[u8]: Immutable`). In this case,
932- // neither `U` nor `[u8]` permit mutation, and so `Shared`
933- // aliasing is satisfied.
934+ // - `I::Aliasing` is `Shared` or `Inaccessible` and `U` is
935+ // `Immutable` (we already know that `[u8]: Immutable`). In
936+ // this case, neither `U` nor `[u8]` permit mutation, and so
937+ // `Shared` aliasing is satisfied. `Inaccessible` is trivially
938+ // satisfied since it imposes no requirements.
934939 // 1. `ptr` conforms to the alignment invariant of `Aligned` because
935940 // it is derived from `try_cast_into`, which promises that the
936941 // object described by `target` is validly aligned for `U`.
@@ -1070,7 +1075,7 @@ mod _project {
10701075 pub unsafe fn project < U : ' a + ?Sized > (
10711076 self ,
10721077 projector : impl FnOnce ( * mut T ) -> * mut U ,
1073- ) -> Ptr < ' a , U , ( I :: Aliasing , Any , Initialized ) > {
1078+ ) -> Ptr < ' a , U , ( I :: Aliasing , Unknown , Initialized ) > {
10741079 // TODO(#1122): If `cast_unsized` were able to reason that, when
10751080 // casting from an `Initialized` pointer, the result is another
10761081 // `Initialized` pointer, we could remove this method entirely.
0 commit comments