Skip to content

Commit 4f5c477

Browse files
Fix clippy safety concerns
1 parent 1cd2a73 commit 4f5c477

File tree

4 files changed

+10
-8
lines changed

4 files changed

+10
-8
lines changed

src/api/minimal/iuf.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ macro_rules! impl_minimal_iuf {
5353

5454
/// Extracts the value at `index`.
5555
///
56-
/// # Precondition
56+
/// # Safety
5757
///
5858
/// If `index >= Self::lanes()` the behavior is undefined.
5959
#[inline]
@@ -80,7 +80,7 @@ macro_rules! impl_minimal_iuf {
8080

8181
/// Returns a new vector where the value at `index` is replaced by `new_value`.
8282
///
83-
/// # Precondition
83+
/// # Safety
8484
///
8585
/// If `index >= Self::lanes()` the behavior is undefined.
8686
#[inline]

src/api/minimal/mask.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ macro_rules! impl_minimal_mask {
5858

5959
/// Extracts the value at `index`.
6060
///
61+
/// # Safety
62+
///
6163
/// If `index >= Self::lanes()` the behavior is undefined.
6264
#[inline]
6365
pub unsafe fn extract_unchecked(self, index: usize) -> bool {
@@ -85,9 +87,9 @@ macro_rules! impl_minimal_mask {
8587
/// Returns a new vector where the value at `index` is replaced by
8688
/// `new_value`.
8789
///
88-
/// # Panics
90+
/// # Safety
8991
///
90-
/// If `index >= Self::lanes()`.
92+
/// If `index >= Self::lanes()` the behavior is undefined.
9193
#[inline]
9294
#[must_use = "replace_unchecked does not modify the original value - \
9395
it returns a new vector with the value at `index` \

src/api/slice/from_slice.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ macro_rules! impl_slice_from_slice {
3838

3939
/// Instantiates a new vector with the values of the `slice`.
4040
///
41-
/// # Precondition
41+
/// # Safety
4242
///
4343
/// If `slice.len() < Self::lanes()` or `&slice[0]` is not aligned
4444
/// to an `align_of::<Self>()` boundary, the behavior is undefined.
@@ -59,7 +59,7 @@ macro_rules! impl_slice_from_slice {
5959

6060
/// Instantiates a new vector with the values of the `slice`.
6161
///
62-
/// # Precondition
62+
/// # Safety
6363
///
6464
/// If `slice.len() < Self::lanes()` the behavior is undefined.
6565
#[inline]

src/api/slice/write_to_slice.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ macro_rules! impl_slice_write_to_slice {
3939

4040
/// Writes the values of the vector to the `slice`.
4141
///
42-
/// # Precondition
42+
/// # Safety
4343
///
4444
/// If `slice.len() < Self::lanes()` or `&slice[0]` is not
4545
/// aligned to an `align_of::<Self>()` boundary, the behavior is
@@ -64,7 +64,7 @@ macro_rules! impl_slice_write_to_slice {
6464

6565
/// Writes the values of the vector to the `slice`.
6666
///
67-
/// # Precondition
67+
/// # Safety
6868
///
6969
/// If `slice.len() < Self::lanes()` the behavior is undefined.
7070
#[inline]

0 commit comments

Comments
 (0)