Skip to content

Commit 061d5ac

Browse files
Merge pull request #392 from rust-lang/minor-fixes
Revert #385 and add some minor fixes
2 parents 6ad779c + d8439e9 commit 061d5ac

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

crates/core_simd/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#![no_std]
22
#![feature(
3-
core_intrinsics,
43
const_intrinsic_copy,
54
const_refs_to_cell,
65
const_maybe_uninit_as_mut_ptr,

crates/core_simd/src/masks.rs

+4-7
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ mod sealed {
3333

3434
fn eq(self, other: Self) -> bool;
3535

36-
fn as_usize(self) -> usize;
36+
fn to_usize(self) -> usize;
3737

3838
type Unsigned: SimdElement;
3939

@@ -65,7 +65,7 @@ macro_rules! impl_element {
6565
fn eq(self, other: Self) -> bool { self == other }
6666

6767
#[inline]
68-
fn as_usize(self) -> usize {
68+
fn to_usize(self) -> usize {
6969
self as usize
7070
}
7171

@@ -174,10 +174,7 @@ where
174174
#[must_use = "method returns a new mask and does not mutate the original value"]
175175
pub unsafe fn from_int_unchecked(value: Simd<T, N>) -> Self {
176176
// Safety: the caller must confirm this invariant
177-
unsafe {
178-
core::intrinsics::assume(<T as Sealed>::valid(value));
179-
Self(mask_impl::Mask::from_int_unchecked(value))
180-
}
177+
unsafe { Self(mask_impl::Mask::from_int_unchecked(value)) }
181178
}
182179

183180
/// Converts a vector of integers to a mask, where 0 represents `false` and -1
@@ -394,7 +391,7 @@ where
394391
if min_index.eq(T::TRUE) {
395392
None
396393
} else {
397-
Some(min_index.as_usize())
394+
Some(min_index.to_usize())
398395
}
399396
}
400397
}

0 commit comments

Comments
 (0)