mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-25 16:24:46 +00:00
Rollup merge of #132895 - scottmcm:generalize-nonnull-from-raw-parts, r=ibraheemdev
Generalize `NonNull::from_raw_parts` per ACP362 I did the raw pointers in #125701, but apparently forgot `NonNull`. cc https://github.com/rust-lang/libs-team/issues/362
This commit is contained in:
commit
72c62688d1
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user