Generalize NonNull::from_raw_parts per ACP362

I did the raw pointers in 125701, but apparently forgot `NonNull`.
This commit is contained in:
Scott McMurray 2024-11-11 00:05:17 -08:00
parent f5b62577f7
commit fb26ba88f8

View file

@ -251,7 +251,7 @@ impl<T: ?Sized> NonNull<T> {
#[unstable(feature = "ptr_metadata", issue = "81513")]
#[inline]
pub const fn from_raw_parts(
data_pointer: NonNull<()>,
data_pointer: NonNull<impl super::Thin>,
metadata: <T as super::Pointee>::Metadata,
) -> NonNull<T> {
// SAFETY: The result of `ptr::from::raw_parts_mut` is non-null because `data_pointer` is.