Skip to content

Commit e9c3147

Browse files
committed
Remove unnecessary Pointee<Metadata=()> bound implied by implicit Sized bound
1 parent 8fd81fe commit e9c3147

3 files changed

Lines changed: 10 additions & 32 deletions

File tree

crates/core_simd/src/simd/ptr/const_ptr.rs

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,15 @@ use crate::simd::{Mask, Simd, SimdElement, cmp::SimdPartialEq, num::SimdUint};
44
/// Operations on SIMD vectors of constant pointers.
55
pub trait SimdConstPtr: SimdElement + Copy + Sealed {
66
/// The pointee type referenced by these pointers.
7-
type Pointee: core::ptr::Pointee<Metadata = ()>;
7+
type Pointee;
88

99
/// Returns `true` for each element that is null.
1010
fn is_null<const N: usize>(self: Simd<Self, N>) -> Mask<isize, N>;
1111

1212
/// Casts to a pointer of another type.
1313
///
1414
/// Equivalent to calling [`pointer::cast`] on each element.
15-
fn cast<U, const N: usize>(self: Simd<Self, N>) -> Simd<*const U, N>
16-
where
17-
U: core::ptr::Pointee<Metadata = ()>;
15+
fn cast<U, const N: usize>(self: Simd<Self, N>) -> Simd<*const U, N>;
1816

1917
/// Changes constness without changing the type.
2018
///
@@ -58,10 +56,7 @@ pub trait SimdConstPtr: SimdElement + Copy + Sealed {
5856
fn wrapping_sub<const N: usize>(self: Simd<Self, N>, count: Simd<usize, N>) -> Simd<Self, N>;
5957
}
6058

61-
impl<T> SimdConstPtr for *const T
62-
where
63-
T: core::ptr::Pointee<Metadata = ()>,
64-
{
59+
impl<T> SimdConstPtr for *const T {
6560
type Pointee = T;
6661

6762
#[inline]
@@ -70,10 +65,7 @@ where
7065
}
7166

7267
#[inline]
73-
fn cast<U, const N: usize>(self: Simd<Self, N>) -> Simd<*const U, N>
74-
where
75-
U: core::ptr::Pointee<Metadata = ()>,
76-
{
68+
fn cast<U, const N: usize>(self: Simd<Self, N>) -> Simd<*const U, N> {
7769
// SimdElement currently requires zero-sized metadata, so this should never fail.
7870
// If this ever changes, `simd_cast_ptr` should produce a post-mono error.
7971
use core::ptr::Pointee;

crates/core_simd/src/simd/ptr/mut_ptr.rs

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,15 @@ use crate::simd::{Mask, Simd, SimdElement, cmp::SimdPartialEq, num::SimdUint};
44
/// Operations on SIMD vectors of mutable pointers.
55
pub trait SimdMutPtr: SimdElement + Copy + Sealed {
66
/// The pointee type referenced by these pointers.
7-
type Pointee: core::ptr::Pointee<Metadata = ()>;
7+
type Pointee;
88

99
/// Returns `true` for each element that is null.
1010
fn is_null<const N: usize>(self: Simd<Self, N>) -> Mask<isize, N>;
1111

1212
/// Casts to a pointer of another type.
1313
///
1414
/// Equivalent to calling [`pointer::cast`] on each element.
15-
fn cast<U, const N: usize>(self: Simd<Self, N>) -> Simd<*mut U, N>
16-
where
17-
U: core::ptr::Pointee<Metadata = ()>;
15+
fn cast<U, const N: usize>(self: Simd<Self, N>) -> Simd<*mut U, N>;
1816

1917
/// Changes constness without changing the type.
2018
///
@@ -58,10 +56,7 @@ pub trait SimdMutPtr: SimdElement + Copy + Sealed {
5856
fn wrapping_sub<const N: usize>(self: Simd<Self, N>, count: Simd<usize, N>) -> Simd<Self, N>;
5957
}
6058

61-
impl<T> SimdMutPtr for *mut T
62-
where
63-
T: core::ptr::Pointee<Metadata = ()>,
64-
{
59+
impl<T> SimdMutPtr for *mut T {
6560
type Pointee = T;
6661

6762
#[inline]
@@ -70,10 +65,7 @@ where
7065
}
7166

7267
#[inline]
73-
fn cast<U, const N: usize>(self: Simd<Self, N>) -> Simd<*mut U, N>
74-
where
75-
U: core::ptr::Pointee<Metadata = ()>,
76-
{
68+
fn cast<U, const N: usize>(self: Simd<Self, N>) -> Simd<*mut U, N> {
7769
// SimdElement currently requires zero-sized metadata, so this should never fail.
7870
// If this ever changes, `simd_cast_ptr` should produce a post-mono error.
7971
use core::ptr::Pointee;

crates/core_simd/src/vector.rs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1179,10 +1179,7 @@ impl<T> Sealed for *const T {}
11791179
// Safety: (thin) const pointers are valid SIMD element types, and are supported by this API
11801180
//
11811181
// Fat pointers may be supported in the future.
1182-
unsafe impl<T> SimdElement for *const T
1183-
where
1184-
T: core::ptr::Pointee<Metadata = ()>,
1185-
{
1182+
unsafe impl<T> SimdElement for *const T {
11861183
type Mask = isize;
11871184
}
11881185

@@ -1191,10 +1188,7 @@ impl<T> Sealed for *mut T {}
11911188
// Safety: (thin) mut pointers are valid SIMD element types, and are supported by this API
11921189
//
11931190
// Fat pointers may be supported in the future.
1194-
unsafe impl<T> SimdElement for *mut T
1195-
where
1196-
T: core::ptr::Pointee<Metadata = ()>,
1197-
{
1191+
unsafe impl<T> SimdElement for *mut T {
11981192
type Mask = isize;
11991193
}
12001194

0 commit comments

Comments
 (0)