Skip to content

Commit 300a266

Browse files
authored
Rollup merge of rust-lang#132895 - scottmcm:generalize-nonnull-from-raw-parts, r=ibraheemdev
Generalize `NonNull::from_raw_parts` per ACP362 I did the raw pointers in rust-lang#125701, but apparently forgot `NonNull`. cc rust-lang/libs-team#362
2 parents 327a0d7 + 0af64b6 commit 300a266

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

core/src/ptr/non_null.rs

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

0 commit comments

Comments
 (0)