Codebase list rust-stfu8 / 1e8d99e src / packed-simd / debian / patches / fix-more-clippy-lints.diff
1e8d99e

Tree @1e8d99e (Download .tar.gz)

fix-more-clippy-lints.diff @1e8d99eraw · history · blame

This patch is based on the upstream commit below, modified to remove
changes to files not present in the Debian package and to remove fuzz.

commit 36d9e8de65f7d6bdef36677c0bb3c69027395fdf
Author: Gabriel Majeri <gabriel.majeri6@gmail.com>
Date:   Fri Nov 22 23:02:34 2019 +0200

    Fix more Clippy lints

Index: rust-packed-simd-0.3.3/src/api/minimal/ptr.rs
===================================================================
--- rust-packed-simd-0.3.3.orig/src/api/minimal/ptr.rs
+++ rust-packed-simd-0.3.3/src/api/minimal/ptr.rs
@@ -68,7 +68,7 @@ macro_rules! impl_minimal_p {
 
             /// Extracts the value at `index`.
             ///
-            /// # Precondition
+            /// # Safety
             ///
             /// If `index >= Self::lanes()` the behavior is undefined.
             #[inline]
@@ -96,7 +96,7 @@ macro_rules! impl_minimal_p {
 
             /// Returns a new vector where the value at `index` is replaced by `new_value`.
             ///
-            /// # Precondition
+            /// # Safety
             ///
             /// If `index >= Self::lanes()` the behavior is undefined.
             #[inline]
@@ -611,7 +611,7 @@ macro_rules! impl_minimal_p {
 
             /// Instantiates a new vector with the values of the `slice`.
             ///
-            /// # Precondition
+            /// # Safety
             ///
             /// If `slice.len() < Self::lanes()` or `&slice[0]` is not aligned
             /// to an `align_of::<Self>()` boundary, the behavior is undefined.
@@ -624,7 +624,7 @@ macro_rules! impl_minimal_p {
 
             /// Instantiates a new vector with the values of the `slice`.
             ///
-            /// # Precondition
+            /// # Safety
             ///
             /// If `slice.len() < Self::lanes()` the behavior is undefined.
             #[inline]
@@ -827,7 +827,7 @@ macro_rules! impl_minimal_p {
 
             /// Writes the values of the vector to the `slice`.
             ///
-            /// # Precondition
+            /// # Safety
             ///
             /// If `slice.len() < Self::lanes()` or `&slice[0]` is not
             /// aligned to an `align_of::<Self>()` boundary, the behavior is
@@ -843,7 +843,7 @@ macro_rules! impl_minimal_p {
 
             /// Writes the values of the vector to the `slice`.
             ///
-            /// # Precondition
+            /// # Safety
             ///
             /// If `slice.len() < Self::lanes()` the behavior is undefined.
             #[inline]
@@ -1151,7 +1151,7 @@ macro_rules! impl_minimal_p {
             /// As such, memory acquired directly from allocators or memory
             /// mapped files may be too large to handle with this function.
             ///
-            /// Consider using wrapping_offset_from instead if these constraints
+            /// Consider using `wrapping_offset_from` instead if these constraints
             /// are difficult to satisfy. The only advantage of this method is
             /// that it enables more aggressive compiler optimizations.
             #[inline]
Index: rust-packed-simd-0.3.3/src/lib.rs
===================================================================
--- rust-packed-simd-0.3.3.orig/src/lib.rs
+++ rust-packed-simd-0.3.3/src/lib.rs
@@ -216,6 +216,8 @@
          clippy::cast_lossless,
          clippy::cast_possible_wrap,
          clippy::cast_precision_loss,
+         // TODO: manually add the `#[must_use]` attribute where appropiate
+         clippy::must_use_candidate,
          // This lint is currently broken for generic code
          // See https://github.com/rust-lang/rust-clippy/issues/3410
          clippy::use_self