Skip to content

Commit 2f4dde0

Browse files
committed
ptr::is_aligned_for - remove T: Sized constraint
1 parent f2db54a commit 2f4dde0

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

library/core/src/ptr/const_ptr.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1444,11 +1444,11 @@ impl<T: ?Sized> *const T {
14441444
///
14451445
/// ```
14461446
/// #![feature(pointer_is_aligned_for)]
1447-
///
1447+
///
14481448
/// // On some platforms, the alignment of i32 is less than 4.
14491449
/// #[repr(align(4))]
14501450
/// struct AlignedI32(i32);
1451-
///
1451+
///
14521452
/// // On some platforms, the alignment of u32 is less than 4.
14531453
/// #[repr(align(4))]
14541454
/// struct AlignedU32(u32);
@@ -1462,9 +1462,9 @@ impl<T: ?Sized> *const T {
14621462
#[must_use]
14631463
#[inline]
14641464
#[unstable(feature = "pointer_is_aligned_for", issue = "140980")]
1465-
pub fn is_aligned_for<U: Sized>(self) -> bool
1465+
pub fn is_aligned_for<U>(self) -> bool
14661466
where
1467-
T: Sized,
1467+
U: Sized,
14681468
{
14691469
self.is_aligned_to(align_of::<U>())
14701470
}

library/core/src/ptr/mut_ptr.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1699,11 +1699,11 @@ impl<T: ?Sized> *mut T {
16991699
///
17001700
/// ```
17011701
/// #![feature(pointer_is_aligned_for)]
1702-
///
1702+
///
17031703
/// // On some platforms, the alignment of i32 is less than 4.
17041704
/// #[repr(align(4))]
17051705
/// struct AlignedI32(i32);
1706-
///
1706+
///
17071707
/// // On some platforms, the alignment of u32 is less than 4.
17081708
/// #[repr(align(4))]
17091709
/// struct AlignedU32(u32);
@@ -1717,9 +1717,9 @@ impl<T: ?Sized> *mut T {
17171717
#[must_use]
17181718
#[inline]
17191719
#[unstable(feature = "pointer_is_aligned_for", issue = "140980")]
1720-
pub fn is_aligned_for<U: Sized>(self) -> bool
1720+
pub fn is_aligned_for<U>(self) -> bool
17211721
where
1722-
T: Sized,
1722+
U: Sized,
17231723
{
17241724
self.is_aligned_to(align_of::<U>())
17251725
}

library/core/src/ptr/non_null.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1307,9 +1307,9 @@ impl<T: ?Sized> NonNull<T> {
13071307
#[must_use]
13081308
#[inline]
13091309
#[unstable(feature = "pointer_is_aligned_for", issue = "140980")]
1310-
pub fn is_aligned_for<U: Sized>(self) -> bool
1310+
pub fn is_aligned_for<U>(self) -> bool
13111311
where
1312-
T: Sized,
1312+
U: Sized,
13131313
{
13141314
self.as_ptr().is_aligned_for::<U>()
13151315
}

0 commit comments

Comments
 (0)