about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2024-11-12 08:07:17 +0100
committerGitHub <noreply@github.com>2024-11-12 08:07:17 +0100
commit72c62688d1343970272bc8a4ff982a7cb31211b0 (patch)
treedb030094c28a4eacf82708a477575346fbb8bc64
parent3a0cc81ca36216d447027444a0936767d5d2396d (diff)
parentfb26ba88f8de15e1980ea0f42ab27880ac81b332 (diff)
downloadrust-72c62688d1343970272bc8a4ff982a7cb31211b0.tar.gz
rust-72c62688d1343970272bc8a4ff982a7cb31211b0.zip
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
-rw-r--r--library/core/src/ptr/non_null.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/library/core/src/ptr/non_null.rs b/library/core/src/ptr/non_null.rs
index ad24e50aa15..b69f8a4b9d3 100644
--- a/library/core/src/ptr/non_null.rs
+++ b/library/core/src/ptr/non_null.rs
@@ -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.