///
/// The pointer can be later reconstructed with [`from_raw_parts_mut`].
#[cfg(not(bootstrap))]
- #[unstable(feature = "ptr_metadata", issue = /* FIXME */ "none")]
- #[rustc_const_unstable(feature = "ptr_metadata", issue = /* FIXME */ "none")]
+ #[unstable(feature = "ptr_metadata", issue = "81513")]
+ #[rustc_const_unstable(feature = "ptr_metadata", issue = "81513")]
#[inline]
pub const fn to_raw_parts(self) -> (*mut (), <T as super::Pointee>::Metadata) {
(self.cast(), super::metadata(self))
#[unstable(feature = "slice_ptr_len", issue = "71146")]
#[rustc_const_unstable(feature = "const_slice_ptr_len", issue = "71146")]
pub const fn len(self) -> usize {
- // SAFETY: this is safe because `*const [T]` and `FatPtr<T>` have the same layout.
- // Only `std` can make this guarantee.
- unsafe { Repr { rust_mut: self }.raw }.len
+ #[cfg(bootstrap)]
+ {
+ // SAFETY: this is safe because `*const [T]` and `FatPtr<T>` have the same layout.
+ // Only `std` can make this guarantee.
+ unsafe { Repr { rust_mut: self }.raw }.len
+ }
+ #[cfg(not(bootstrap))]
+ metadata(self)
}
/// Returns a raw pointer to the slice's buffer.