Skip to content

Commit 75feb38

Browse files
authored
Unrolled build for #149839
Rollup merge of #149839 - theemathas:trivial-clone-pointee-sized, r=joboet Use `PointeeSized` bound for `TrivialClone` impls These `TrivialClone` impls previously had `?Sized` bounds, which are different from the `PointeeSized` bounds on the corresponding `Clone` and `Copy` impls. So, I've changed the `?Sized` bounds into `PointeeSized` bounds. This mistake was made presumably because the `TrivialClone` PR (#135634) was opened in Jan 2025, but merged in Nov 2025. During that time, the sized hierachy PR (#137944) was opened in Mar 2025, and merged in Jun 2025. The `TrivialClone` PR was not updated to account for the sized hierachy changes. r? `@joboet`
2 parents a9ac706 + 9e4e9e4 commit 75feb38

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

library/core/src/marker.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -860,7 +860,7 @@ impl<T: PointeeSized> Clone for PhantomData<T> {
860860

861861
#[doc(hidden)]
862862
#[unstable(feature = "trivial_clone", issue = "none")]
863-
unsafe impl<T: ?Sized> TrivialClone for PhantomData<T> {}
863+
unsafe impl<T: PointeeSized> TrivialClone for PhantomData<T> {}
864864

865865
#[stable(feature = "rust1", since = "1.0.0")]
866866
#[rustc_const_unstable(feature = "const_default", issue = "143894")]

library/core/src/ptr/metadata.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ impl<Dyn: PointeeSized> Clone for DynMetadata<Dyn> {
233233
}
234234

235235
#[doc(hidden)]
236-
unsafe impl<Dyn: ?Sized> TrivialClone for DynMetadata<Dyn> {}
236+
unsafe impl<Dyn: PointeeSized> TrivialClone for DynMetadata<Dyn> {}
237237

238238
impl<Dyn: PointeeSized> Eq for DynMetadata<Dyn> {}
239239

library/core/src/ptr/non_null.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1656,7 +1656,7 @@ impl<T: PointeeSized> Copy for NonNull<T> {}
16561656

16571657
#[doc(hidden)]
16581658
#[unstable(feature = "trivial_clone", issue = "none")]
1659-
unsafe impl<T: ?Sized> TrivialClone for NonNull<T> {}
1659+
unsafe impl<T: PointeeSized> TrivialClone for NonNull<T> {}
16601660

16611661
#[unstable(feature = "coerce_unsized", issue = "18598")]
16621662
impl<T: PointeeSized, U: PointeeSized> CoerceUnsized<NonNull<U>> for NonNull<T> where T: Unsize<U> {}

library/core/src/ptr/unique.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ impl<T: PointeeSized> Copy for Unique<T> {}
168168

169169
#[doc(hidden)]
170170
#[unstable(feature = "trivial_clone", issue = "none")]
171-
unsafe impl<T: ?Sized> TrivialClone for Unique<T> {}
171+
unsafe impl<T: PointeeSized> TrivialClone for Unique<T> {}
172172

173173
#[unstable(feature = "ptr_internals", issue = "none")]
174174
impl<T: PointeeSized, U: PointeeSized> CoerceUnsized<Unique<U>> for Unique<T> where T: Unsize<U> {}

0 commit comments

Comments
 (0)