Skip to content

Commit

Permalink
Rollup merge of rust-lang#132895 - scottmcm:generalize-nonnull-from-r…
Browse files Browse the repository at this point in the history
…aw-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
  • Loading branch information
matthiaskrgr authored Nov 12, 2024
2 parents 327a0d7 + 0af64b6 commit 300a266
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/src/ptr/non_null.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 300a266

Please sign in to comment.