Remove Mask trait

This commit is contained in:
Caleb Zulawski 2021-08-07 01:17:27 +00:00
parent 8cc38ae292
commit ddc67e3bf2

View File

@ -14,20 +14,6 @@ mod mask_impl;
use crate::{SimdI16, SimdI32, SimdI64, SimdI8, SimdIsize};
mod sealed {
pub trait Sealed {}
}
/// Helper trait for mask types.
pub trait Mask: sealed::Sealed {
/// The number of lanes for this mask.
const LANES: usize;
/// Generates a mask with the same value in every lane.
#[must_use]
fn splat(val: bool) -> Self;
}
macro_rules! define_opaque_mask {
{
$(#[$attr:meta])*
@ -40,23 +26,6 @@ macro_rules! define_opaque_mask {
where
crate::LaneCount<LANES>: crate::SupportedLaneCount;
impl<const LANES: usize> sealed::Sealed for $name<LANES>
where
crate::LaneCount<LANES>: crate::SupportedLaneCount,
{}
impl<const LANES: usize> Mask for $name<LANES>
where
crate::LaneCount<LANES>: crate::SupportedLaneCount,
{
const LANES: usize = LANES;
#[inline]
fn splat(value: bool) -> Self {
Self::splat(value)
}
}
impl_opaque_mask_reductions! { $name, $bits_ty }
impl<const LANES: usize> $name<LANES>