Codebase list rust-libslirp / 1e8d99e
packed-simd - apply patches for new rustc. Peter Michael Green 2 years ago
12 changed file(s) with 1386 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
0 rust-packed-simd (0.3.3-8) UNRELEASED-FIXME-AUTOGENERATED-DEBCARGO; urgency=medium
1
2 * Team upload.
3 * Package packed_simd 0.3.3 from crates.io using debcargo 2.4.4
4 * Apply more upstream patch to fix build with new rustc (Closes: 997581).
5 * Add build-depends on rustc 1.56, since the changes to fix the
6 build with the new rustc break the build with the rustc in
7 testing.
8
9 -- Peter Michael Green <plugwash@debian.org> Sun, 24 Oct 2021 23:18:09 +0000
10
011 rust-packed-simd (0.3.3-7) unstable; urgency=medium
112
213 * Team upload.
33 "kpcyrd <git@rxv.cc>"
44 ]
55 excludes = ["ci/**"]
6
7 [source]
8 build_depends = ["rustc (>= 1.56)"]
0 This patch is based on the upstream commit described below,
1 modified to remove fuzz.
2
3 commit cf55ba1d20af34bf7bde10cb199f429aa06a9568
4 Author: Gabriel Majeri <gabriel.majeri6@gmail.com>
5 Date: Fri Sep 27 15:52:25 2019 +0300
6
7 Fix Clippy for main crate
8
9 Index: rust-packed-simd-0.3.3/src/api/minimal/ptr.rs
10 ===================================================================
11 --- rust-packed-simd-0.3.3.orig/src/api/minimal/ptr.rs
12 +++ rust-packed-simd-0.3.3/src/api/minimal/ptr.rs
13 @@ -215,7 +215,7 @@ macro_rules! impl_minimal_p {
14 f,
15 "{}<{}>(",
16 stringify!($id),
17 - unsafe { crate::intrinsics::type_name::<T>() }
18 + crate::intrinsics::type_name::<T>()
19 )?;
20 for i in 0..$elem_count {
21 if i > 0 {
22 Index: rust-packed-simd-0.3.3/src/lib.rs
23 ===================================================================
24 --- rust-packed-simd-0.3.3.orig/src/lib.rs
25 +++ rust-packed-simd-0.3.3/src/lib.rs
26 @@ -220,7 +220,8 @@
27 clippy::must_use_candidate,
28 // This lint is currently broken for generic code
29 // See https://github.com/rust-lang/rust-clippy/issues/3410
30 - clippy::use_self
31 + clippy::use_self,
32 + clippy::wrong_self_convention
33 )]
34 #![cfg_attr(test, feature(hashmap_internals))]
35 #![deny(warnings, rust_2018_idioms, clippy::missing_inline_in_public_items)]
36 Index: rust-packed-simd-0.3.3/src/masks.rs
37 ===================================================================
38 --- rust-packed-simd-0.3.3.orig/src/masks.rs
39 +++ rust-packed-simd-0.3.3/src/masks.rs
40 @@ -7,6 +7,7 @@ macro_rules! impl_mask_ty {
41 pub struct $id($elem_ty);
42
43 impl crate::sealed::Mask for $id {
44 + #[inline]
45 fn test(&self) -> bool {
46 $id::test(self)
47 }
0 This patch is based on the upstream commit described below, with changes
1 to files not present in the Debian package removed.
2
3 commit acd3aef63607d8c1b256943f9f53e7bfb7680352
4 Author: gnzlbg <gonzalobg88@gmail.com>
5 Date: Thu Feb 7 13:47:26 2019 +0100
6
7 Fix clippy issues
8
9 diff --git a/src/api/cast.rs b/src/api/cast.rs
10 index 70ce4615a..f1c32ca1a 100644
11 --- a/src/api/cast.rs
12 +++ b/src/api/cast.rs
13 @@ -1,11 +1,5 @@
14 //! Implementation of `FromCast` and `IntoCast`.
15 -#![cfg_attr(
16 - feature = "cargo-clippy",
17 - allow(
18 - clippy::module_name_repetitions,
19 - clippy::stutter
20 - )
21 -)]
22 +#![allow(clippy::module_name_repetitions)]
23
24 /// Numeric cast from `T` to `Self`.
25 ///
26 diff --git a/src/api/cmp/partial_eq.rs b/src/api/cmp/partial_eq.rs
27 index 7e2782f0f..1712a0de5 100644
28 --- a/src/api/cmp/partial_eq.rs
29 +++ b/src/api/cmp/partial_eq.rs
30 @@ -7,7 +7,7 @@ macro_rules! impl_cmp_partial_eq {
31 ($true:expr, $false:expr)
32 ) => {
33 // FIXME: https://github.com/rust-lang-nursery/rust-clippy/issues/2892
34 - #[cfg_attr(feature = "cargo-clippy", allow(clippy::partialeq_ne_impl))]
35 + #[allow(clippy::partialeq_ne_impl)]
36 impl crate::cmp::PartialEq<$id> for $id {
37 #[inline]
38 fn eq(&self, other: &Self) -> bool {
39 @@ -20,7 +20,7 @@ macro_rules! impl_cmp_partial_eq {
40 }
41
42 // FIXME: https://github.com/rust-lang-nursery/rust-clippy/issues/2892
43 - #[cfg_attr(feature = "cargo-clippy", allow(clippy::partialeq_ne_impl))]
44 + #[allow(clippy::partialeq_ne_impl)]
45 impl crate::cmp::PartialEq<LexicographicallyOrdered<$id>>
46 for LexicographicallyOrdered<$id>
47 {
48 @@ -34,12 +34,13 @@ macro_rules! impl_cmp_partial_eq {
49 }
50 }
51
52 - test_if!{
53 + test_if! {
54 $test_tt:
55 paste::item! {
56 pub mod [<$id _cmp_PartialEq>] {
57 use super::*;
58 - #[cfg_attr(not(target_arch = "wasm32"), test)] #[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)]
59 + #[cfg_attr(not(target_arch = "wasm32"), test)]
60 + #[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)]
61 fn partial_eq() {
62 let a = $id::splat($false);
63 let b = $id::splat($true);
64 diff --git a/src/api/fmt/binary.rs b/src/api/fmt/binary.rs
65 index c758dadcc..b60769082 100644
66 --- a/src/api/fmt/binary.rs
67 +++ b/src/api/fmt/binary.rs
68 @@ -3,11 +3,10 @@
69 macro_rules! impl_fmt_binary {
70 ([$elem_ty:ident; $elem_count:expr]: $id:ident | $test_tt:tt) => {
71 impl crate::fmt::Binary for $id {
72 - #[cfg_attr(
73 - feature = "cargo-clippy", allow(clippy::missing_inline_in_public_items)
74 - )]
75 - fn fmt(&self, f: &mut crate::fmt::Formatter<'_>)
76 - -> crate::fmt::Result {
77 + #[allow(clippy::missing_inline_in_public_items)]
78 + fn fmt(
79 + &self, f: &mut crate::fmt::Formatter<'_>,
80 + ) -> crate::fmt::Result {
81 write!(f, "{}(", stringify!($id))?;
82 for i in 0..$elem_count {
83 if i > 0 {
84 @@ -18,12 +17,13 @@ macro_rules! impl_fmt_binary {
85 write!(f, ")")
86 }
87 }
88 - test_if!{
89 + test_if! {
90 $test_tt:
91 paste::item! {
92 pub mod [<$id _fmt_binary>] {
93 use super::*;
94 - #[cfg_attr(not(target_arch = "wasm32"), test)] #[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)]
95 + #[cfg_attr(not(target_arch = "wasm32"), test)]
96 + #[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)]
97 fn binary() {
98 use arrayvec::{ArrayString,ArrayVec};
99 type TinyString = ArrayString<[u8; 512]>;
100 diff --git a/src/api/fmt/debug.rs b/src/api/fmt/debug.rs
101 index f34a237d9..ad0b8a59a 100644
102 --- a/src/api/fmt/debug.rs
103 +++ b/src/api/fmt/debug.rs
104 @@ -2,12 +2,13 @@
105
106 macro_rules! impl_fmt_debug_tests {
107 ([$elem_ty:ty; $elem_count:expr]: $id:ident | $test_tt:tt) => {
108 - test_if!{
109 + test_if! {
110 $test_tt:
111 paste::item! {
112 pub mod [<$id _fmt_debug>] {
113 use super::*;
114 - #[cfg_attr(not(target_arch = "wasm32"), test)] #[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)]
115 + #[cfg_attr(not(target_arch = "wasm32"), test)]
116 + #[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)]
117 fn debug() {
118 use arrayvec::{ArrayString,ArrayVec};
119 type TinyString = ArrayString<[u8; 512]>;
120 @@ -42,10 +43,7 @@ macro_rules! impl_fmt_debug_tests {
121 macro_rules! impl_fmt_debug {
122 ([$elem_ty:ty; $elem_count:expr]: $id:ident | $test_tt:tt) => {
123 impl crate::fmt::Debug for $id {
124 - #[cfg_attr(
125 - feature = "cargo-clippy",
126 - allow(clippy::missing_inline_in_public_items)
127 - )]
128 + #[allow(clippy::missing_inline_in_public_items)]
129 fn fmt(
130 &self, f: &mut crate::fmt::Formatter<'_>,
131 ) -> crate::fmt::Result {
132 diff --git a/src/api/fmt/lower_hex.rs b/src/api/fmt/lower_hex.rs
133 index ac6ea9593..5a7aa14b5 100644
134 --- a/src/api/fmt/lower_hex.rs
135 +++ b/src/api/fmt/lower_hex.rs
136 @@ -3,11 +3,10 @@
137 macro_rules! impl_fmt_lower_hex {
138 ([$elem_ty:ident; $elem_count:expr]: $id:ident | $test_tt:tt) => {
139 impl crate::fmt::LowerHex for $id {
140 - #[cfg_attr(
141 - feature = "cargo-clippy", allow(clippy::missing_inline_in_public_items)
142 - )]
143 - fn fmt(&self, f: &mut crate::fmt::Formatter<'_>)
144 - -> crate::fmt::Result {
145 + #[allow(clippy::missing_inline_in_public_items)]
146 + fn fmt(
147 + &self, f: &mut crate::fmt::Formatter<'_>,
148 + ) -> crate::fmt::Result {
149 write!(f, "{}(", stringify!($id))?;
150 for i in 0..$elem_count {
151 if i > 0 {
152 @@ -18,12 +17,13 @@ macro_rules! impl_fmt_lower_hex {
153 write!(f, ")")
154 }
155 }
156 - test_if!{
157 + test_if! {
158 $test_tt:
159 paste::item! {
160 pub mod [<$id _fmt_lower_hex>] {
161 use super::*;
162 - #[cfg_attr(not(target_arch = "wasm32"), test)] #[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)]
163 + #[cfg_attr(not(target_arch = "wasm32"), test)]
164 + #[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)]
165 fn lower_hex() {
166 use arrayvec::{ArrayString,ArrayVec};
167 type TinyString = ArrayString<[u8; 512]>;
168 diff --git a/src/api/fmt/octal.rs b/src/api/fmt/octal.rs
169 index ff78a332b..83ac8abc7 100644
170 --- a/src/api/fmt/octal.rs
171 +++ b/src/api/fmt/octal.rs
172 @@ -3,11 +3,10 @@
173 macro_rules! impl_fmt_octal {
174 ([$elem_ty:ident; $elem_count:expr]: $id:ident | $test_tt:tt) => {
175 impl crate::fmt::Octal for $id {
176 - #[cfg_attr(
177 - feature = "cargo-clippy", allow(clippy::missing_inline_in_public_items)
178 - )]
179 - fn fmt(&self, f: &mut crate::fmt::Formatter<'_>)
180 - -> crate::fmt::Result {
181 + #[allow(clippy::missing_inline_in_public_items)]
182 + fn fmt(
183 + &self, f: &mut crate::fmt::Formatter<'_>,
184 + ) -> crate::fmt::Result {
185 write!(f, "{}(", stringify!($id))?;
186 for i in 0..$elem_count {
187 if i > 0 {
188 @@ -18,12 +17,13 @@ macro_rules! impl_fmt_octal {
189 write!(f, ")")
190 }
191 }
192 - test_if!{
193 + test_if! {
194 $test_tt:
195 paste::item! {
196 pub mod [<$id _fmt_octal>] {
197 use super::*;
198 - #[cfg_attr(not(target_arch = "wasm32"), test)] #[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)]
199 + #[cfg_attr(not(target_arch = "wasm32"), test)]
200 + #[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)]
201 fn octal_hex() {
202 use arrayvec::{ArrayString,ArrayVec};
203 type TinyString = ArrayString<[u8; 512]>;
204 diff --git a/src/api/fmt/upper_hex.rs b/src/api/fmt/upper_hex.rs
205 index ab60c7e22..aa88f673a 100644
206 --- a/src/api/fmt/upper_hex.rs
207 +++ b/src/api/fmt/upper_hex.rs
208 @@ -3,11 +3,10 @@
209 macro_rules! impl_fmt_upper_hex {
210 ([$elem_ty:ident; $elem_count:expr]: $id:ident | $test_tt:tt) => {
211 impl crate::fmt::UpperHex for $id {
212 - #[cfg_attr(
213 - feature = "cargo-clippy", allow(clippy::missing_inline_in_public_items)
214 - )]
215 - fn fmt(&self, f: &mut crate::fmt::Formatter<'_>)
216 - -> crate::fmt::Result {
217 + #[allow(clippy::missing_inline_in_public_items)]
218 + fn fmt(
219 + &self, f: &mut crate::fmt::Formatter<'_>,
220 + ) -> crate::fmt::Result {
221 write!(f, "{}(", stringify!($id))?;
222 for i in 0..$elem_count {
223 if i > 0 {
224 @@ -18,12 +17,13 @@ macro_rules! impl_fmt_upper_hex {
225 write!(f, ")")
226 }
227 }
228 - test_if!{
229 + test_if! {
230 $test_tt:
231 paste::item! {
232 pub mod [<$id _fmt_upper_hex>] {
233 use super::*;
234 - #[cfg_attr(not(target_arch = "wasm32"), test)] #[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)]
235 + #[cfg_attr(not(target_arch = "wasm32"), test)]
236 + #[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)]
237 fn upper_hex() {
238 use arrayvec::{ArrayString,ArrayVec};
239 type TinyString = ArrayString<[u8; 512]>;
240 diff --git a/src/api/minimal/iuf.rs b/src/api/minimal/iuf.rs
241 index ed85cf769..58ffabab9 100644
242 --- a/src/api/minimal/iuf.rs
243 +++ b/src/api/minimal/iuf.rs
244 @@ -18,8 +18,7 @@ macro_rules! impl_minimal_iuf {
245 /// Creates a new instance with each vector elements initialized
246 /// with the provided values.
247 #[inline]
248 - #[cfg_attr(feature = "cargo-clippy",
249 - allow(clippy::too_many_arguments))]
250 + #[allow(clippy::too_many_arguments)]
251 pub const fn new($($elem_name: $elem_ty),*) -> Self {
252 Simd(codegen::$id($($elem_name as $ielem_ty),*))
253 }
254 diff --git a/src/api/minimal/mask.rs b/src/api/minimal/mask.rs
255 index 18ca5b24f..e65be95db 100644
256 --- a/src/api/minimal/mask.rs
257 +++ b/src/api/minimal/mask.rs
258 @@ -16,16 +16,14 @@ macro_rules! impl_minimal_mask {
259 /// Creates a new instance with each vector elements initialized
260 /// with the provided values.
261 #[inline]
262 - #[cfg_attr(feature = "cargo-clippy",
263 - allow(clippy::too_many_arguments))]
264 + #[allow(clippy::too_many_arguments)]
265 pub const fn new($($elem_name: bool),*) -> Self {
266 Simd(codegen::$id($(Self::bool_to_internal($elem_name)),*))
267 }
268
269 /// Converts a boolean type into the type of the vector lanes.
270 #[inline]
271 - #[cfg_attr(feature = "cargo-clippy",
272 - allow(clippy::indexing_slicing))]
273 + #[allow(clippy::indexing_slicing)]
274 const fn bool_to_internal(x: bool) -> $ielem_ty {
275 [0 as $ielem_ty, !(0 as $ielem_ty)][x as usize]
276 }
277 diff --git a/src/api/minimal/ptr.rs b/src/api/minimal/ptr.rs
278 index 38b8a73c9..75e5aad5c 100644
279 --- a/src/api/minimal/ptr.rs
280 +++ b/src/api/minimal/ptr.rs
281 @@ -19,8 +19,7 @@ macro_rules! impl_minimal_p {
282 /// Creates a new instance with each vector elements initialized
283 /// with the provided values.
284 #[inline]
285 - #[cfg_attr(feature = "cargo-clippy",
286 - allow(clippy::too_many_arguments))]
287 + #[allow(clippy::too_many_arguments)]
288 pub const fn new($($elem_name: $elem_ty),*) -> Self {
289 Simd(codegen::$id($($elem_name),*))
290 }
291 @@ -89,8 +88,7 @@ macro_rules! impl_minimal_p {
292 it returns a new vector with the value at `index` \
293 replaced by `new_value`d"
294 ]
295 - #[cfg_attr(feature = "cargo-clippy",
296 - allow(clippy::not_unsafe_ptr_arg_deref))]
297 + #[allow(clippy::not_unsafe_ptr_arg_deref)]
298 pub fn replace(self, index: usize, new_value: $elem_ty) -> Self {
299 assert!(index < $elem_count);
300 unsafe { self.replace_unchecked(index, new_value) }
301 @@ -210,8 +208,7 @@ macro_rules! impl_minimal_p {
302 }
303
304 impl<T> crate::fmt::Debug for $id<T> {
305 - #[cfg_attr(feature = "cargo-clippy",
306 - allow(clippy::missing_inline_in_public_items))]
307 + #[allow(clippy::missing_inline_in_public_items)]
308 fn fmt(&self, f: &mut crate::fmt::Formatter<'_>)
309 -> crate::fmt::Result {
310 write!(
311 @@ -424,7 +421,7 @@ macro_rules! impl_minimal_p {
312 }
313 }
314
315 - #[cfg_attr(feature = "cargo-clippy", allow(clippy::partialeq_ne_impl))]
316 + #[allow(clippy::partialeq_ne_impl)]
317 impl<T> crate::cmp::PartialEq<$id<T>> for $id<T> {
318 #[inline]
319 fn eq(&self, other: &Self) -> bool {
320 @@ -437,7 +434,7 @@ macro_rules! impl_minimal_p {
321 }
322
323 // FIXME: https://github.com/rust-lang-nursery/rust-clippy/issues/2892
324 - #[cfg_attr(feature = "cargo-clippy", allow(clippy::partialeq_ne_impl))]
325 + #[allow(clippy::partialeq_ne_impl)]
326 impl<T> crate::cmp::PartialEq<LexicographicallyOrdered<$id<T>>>
327 for LexicographicallyOrdered<$id<T>>
328 {
329 @@ -621,8 +618,7 @@ macro_rules! impl_minimal_p {
330 #[inline]
331 pub unsafe fn from_slice_aligned_unchecked(slice: &[$elem_ty])
332 -> Self {
333 - #[cfg_attr(feature = "cargo-clippy",
334 - allow(clippy::cast_ptr_alignment))]
335 + #[allow(clippy::cast_ptr_alignment)]
336 *(slice.get_unchecked(0) as *const $elem_ty as *const Self)
337 }
338
339 @@ -840,8 +836,7 @@ macro_rules! impl_minimal_p {
340 pub unsafe fn write_to_slice_aligned_unchecked(
341 self, slice: &mut [$elem_ty],
342 ) {
343 - #[cfg_attr(feature = "cargo-clippy",
344 - allow(clippy::cast_ptr_alignment))]
345 + #[allow(clippy::cast_ptr_alignment)]
346 *(slice.get_unchecked_mut(0) as *mut $elem_ty as *mut Self) =
347 self;
348 }
349 @@ -1225,8 +1220,7 @@ macro_rules! impl_minimal_p {
350 /// are difficult to satisfy. The only advantage of this method is
351 /// that it enables more aggressive compiler optimizations.
352 #[inline]
353 - #[cfg_attr(feature = "cargo-clippy",
354 - allow(clippy::should_implement_trait))]
355 + #[allow(clippy::should_implement_trait)]
356 pub unsafe fn add(self, count: $usize_ty) -> Self {
357 self.offset(count.cast())
358 }
359 @@ -1271,8 +1265,7 @@ macro_rules! impl_minimal_p {
360 /// are difficult to satisfy. The only advantage of this method is
361 /// that it enables more aggressive compiler optimizations.
362 #[inline]
363 - #[cfg_attr(feature = "cargo-clippy",
364 - allow(clippy::should_implement_trait))]
365 + #[allow(clippy::should_implement_trait)]
366 pub unsafe fn sub(self, count: $usize_ty) -> Self {
367 let x: $isize_ty = count.cast();
368 // note: - is currently wrapping_neg
369 diff --git a/src/api/reductions/mask.rs b/src/api/reductions/mask.rs
370 index 13d713067..0dd6a84e7 100644
371 --- a/src/api/reductions/mask.rs
372 +++ b/src/api/reductions/mask.rs
373 @@ -20,12 +20,13 @@ macro_rules! impl_reduction_mask {
374 }
375 }
376
377 - test_if!{
378 + test_if! {
379 $test_tt:
380 paste::item! {
381 pub mod [<$id _reduction>] {
382 use super::*;
383 - #[cfg_attr(not(target_arch = "wasm32"), test)] #[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)]
384 + #[cfg_attr(not(target_arch = "wasm32"), test)]
385 + #[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)]
386 fn all() {
387 let a = $id::splat(true);
388 assert!(a.all());
389 @@ -43,7 +44,8 @@ macro_rules! impl_reduction_mask {
390 }
391 }
392 }
393 - #[cfg_attr(not(target_arch = "wasm32"), test)] #[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)]
394 + #[cfg_attr(not(target_arch = "wasm32"), test)]
395 + #[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)]
396 fn any() {
397 let a = $id::splat(true);
398 assert!(a.any());
399 @@ -61,7 +63,8 @@ macro_rules! impl_reduction_mask {
400 }
401 }
402 }
403 - #[cfg_attr(not(target_arch = "wasm32"), test)] #[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)]
404 + #[cfg_attr(not(target_arch = "wasm32"), test)]
405 + #[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)]
406 fn none() {
407 let a = $id::splat(true);
408 assert!(!a.none());
409 diff --git a/src/api/slice/from_slice.rs b/src/api/slice/from_slice.rs
410 index ca83c7df7..109cd1f10 100644
411 --- a/src/api/slice/from_slice.rs
412 +++ b/src/api/slice/from_slice.rs
413 @@ -53,10 +53,7 @@ macro_rules! impl_slice_from_slice {
414 0
415 );
416
417 - #[cfg_attr(
418 - feature = "cargo-clippy",
419 - allow(clippy::cast_ptr_alignment)
420 - )]
421 + #[allow(clippy::cast_ptr_alignment)]
422 *(target_ptr as *const Self)
423 }
424
425 diff --git a/src/api/slice/write_to_slice.rs b/src/api/slice/write_to_slice.rs
426 index becb564d4..fcb288da7 100644
427 --- a/src/api/slice/write_to_slice.rs
428 +++ b/src/api/slice/write_to_slice.rs
429 @@ -55,20 +55,10 @@ macro_rules! impl_slice_write_to_slice {
430 0
431 );
432
433 - #[cfg_attr(feature = "cargo-clippy",
434 - allow(clippy::cast_ptr_alignment))]
435 - #[cfg_attr(
436 - feature = "cargo-clippy",
437 - allow(clippy::cast_ptr_alignment)
438 - )]
439 - #[cfg_attr(
440 - feature = "cargo-clippy",
441 - allow(clippy::cast_ptr_alignment)
442 - )]
443 - #[cfg_attr(
444 - feature = "cargo-clippy",
445 - allow(clippy::cast_ptr_alignment)
446 - )]
447 + #[allow(clippy::cast_ptr_alignment)]
448 + #[allow(clippy::cast_ptr_alignment)]
449 + #[allow(clippy::cast_ptr_alignment)]
450 + #[allow(clippy::cast_ptr_alignment)]
451 *(target_ptr as *mut Self) = self;
452 }
453
454 diff --git a/src/codegen/math/float.rs b/src/codegen/math/float.rs
455 index 02a2bea08..5e89bf6ae 100644
456 --- a/src/codegen/math/float.rs
457 +++ b/src/codegen/math/float.rs
458 @@ -1,5 +1,5 @@
459 //! Vertical floating-point math operations.
460 -#![cfg_attr(feature = "cargo-clippy", allow(clippy::useless_transmute))]
461 +#![allow(clippy::useless_transmute)]
462
463 #[macro_use]
464 crate mod macros;
465 diff --git a/src/codegen/swap_bytes.rs b/src/codegen/swap_bytes.rs
466 index 15d47f68e..b435fb5da 100644
467 --- a/src/codegen/swap_bytes.rs
468 +++ b/src/codegen/swap_bytes.rs
469 @@ -24,7 +24,7 @@ macro_rules! impl_swap_bytes {
470 $(
471 impl SwapBytes for $id {
472 #[inline]
473 - #[cfg_attr(feature = "cargo-clippy", allow(clippy::useless_transmute))]
474 + #[allow(clippy::useless_transmute)]
475 fn swap_bytes(self) -> Self {
476 unsafe {
477 let bytes: u8x4 = crate::mem::transmute(self);
478 @@ -39,7 +39,7 @@ macro_rules! impl_swap_bytes {
479 $(
480 impl SwapBytes for $id {
481 #[inline]
482 - #[cfg_attr(feature = "cargo-clippy", allow(clippy::useless_transmute))]
483 + #[allow(clippy::useless_transmute)]
484 fn swap_bytes(self) -> Self {
485 unsafe {
486 let bytes: u8x8 = crate::mem::transmute(self);
487 @@ -56,7 +56,7 @@ macro_rules! impl_swap_bytes {
488 $(
489 impl SwapBytes for $id {
490 #[inline]
491 - #[cfg_attr(feature = "cargo-clippy", allow(clippy::useless_transmute))]
492 + #[allow(clippy::useless_transmute)]
493 fn swap_bytes(self) -> Self {
494 unsafe {
495 let bytes: u8x16 = crate::mem::transmute(self);
496 @@ -74,7 +74,7 @@ macro_rules! impl_swap_bytes {
497 $(
498 impl SwapBytes for $id {
499 #[inline]
500 - #[cfg_attr(feature = "cargo-clippy", allow(clippy::useless_transmute))]
501 + #[allow(clippy::useless_transmute)]
502 fn swap_bytes(self) -> Self {
503 unsafe {
504 let bytes: u8x32 = crate::mem::transmute(self);
505 @@ -94,7 +94,7 @@ macro_rules! impl_swap_bytes {
506 $(
507 impl SwapBytes for $id {
508 #[inline]
509 - #[cfg_attr(feature = "cargo-clippy", allow(clippy::useless_transmute))]
510 + #[allow(clippy::useless_transmute)]
511 fn swap_bytes(self) -> Self {
512 unsafe {
513 let bytes: u8x64 = crate::mem::transmute(self);
514 diff --git a/src/lib.rs b/src/lib.rs
515 index b27e9ace2..d73645e72 100644
516 --- a/src/lib.rs
517 +++ b/src/lib.rs
518 @@ -214,25 +214,17 @@
519 crate_visibility_modifier,
520 custom_inner_attributes
521 )]
522 -#![allow(non_camel_case_types, non_snake_case)]
523 -#![cfg_attr(test, feature(hashmap_internals))]
524 -#![cfg_attr(
525 - feature = "cargo-clippy",
526 - allow(
527 - clippy::cast_possible_truncation,
528 - clippy::cast_lossless,
529 - clippy::cast_possible_wrap,
530 - clippy::cast_precision_loss,
531 - // This lint is currently broken for generic code
532 - // See https://github.com/rust-lang/rust-clippy/issues/3410
533 - clippy::use_self
534 - )
535 -)]
536 -#![cfg_attr(
537 - feature = "cargo-clippy",
538 - deny(clippy::missing_inline_in_public_items)
539 +#![allow(non_camel_case_types, non_snake_case,
540 + clippy::cast_possible_truncation,
541 + clippy::cast_lossless,
542 + clippy::cast_possible_wrap,
543 + clippy::cast_precision_loss,
544 + // This lint is currently broken for generic code
545 + // See https://github.com/rust-lang/rust-clippy/issues/3410
546 + clippy::use_self
547 )]
548 -#![deny(warnings, rust_2018_idioms)]
549 +#![cfg_attr(test, feature(hashmap_internals))]
550 +#![deny(warnings, rust_2018_idioms, clippy::missing_inline_in_public_items)]
551 #![no_std]
552
553 use cfg_if::cfg_if;
554 @@ -288,10 +280,7 @@ pub struct Simd<A: sealed::SimdArray>(
555 /// and/or `Ord` traits.
556 #[repr(transparent)]
557 #[derive(Copy, Clone, Debug)]
558 -#[cfg_attr(
559 - feature = "cargo-clippy",
560 - allow(clippy::missing_inline_in_public_items)
561 -)]
562 +#[allow(clippy::missing_inline_in_public_items)]
563 pub struct LexicographicallyOrdered<T>(T);
564
565 mod masks;
566 diff --git a/src/masks.rs b/src/masks.rs
567 index 65c15cc5d..f83c4da95 100644
568 --- a/src/masks.rs
569 +++ b/src/masks.rs
570 @@ -36,7 +36,7 @@ macro_rules! impl_mask_ty {
571 }
572 }
573
574 - #[cfg_attr(feature = "cargo-clippy", allow(clippy::partialeq_ne_impl))]
575 + #[allow(clippy::partialeq_ne_impl)]
576 impl PartialEq<$id> for $id {
577 #[inline]
578 fn eq(&self, other: &Self) -> bool {
0 This patch is based on the upstream commit below, modified to remove
1 changes to files not present in the Debian package and to remove fuzz.
2
3 commit 36d9e8de65f7d6bdef36677c0bb3c69027395fdf
4 Author: Gabriel Majeri <gabriel.majeri6@gmail.com>
5 Date: Fri Nov 22 23:02:34 2019 +0200
6
7 Fix more Clippy lints
8
9 Index: rust-packed-simd-0.3.3/src/api/minimal/ptr.rs
10 ===================================================================
11 --- rust-packed-simd-0.3.3.orig/src/api/minimal/ptr.rs
12 +++ rust-packed-simd-0.3.3/src/api/minimal/ptr.rs
13 @@ -68,7 +68,7 @@ macro_rules! impl_minimal_p {
14
15 /// Extracts the value at `index`.
16 ///
17 - /// # Precondition
18 + /// # Safety
19 ///
20 /// If `index >= Self::lanes()` the behavior is undefined.
21 #[inline]
22 @@ -96,7 +96,7 @@ macro_rules! impl_minimal_p {
23
24 /// Returns a new vector where the value at `index` is replaced by `new_value`.
25 ///
26 - /// # Precondition
27 + /// # Safety
28 ///
29 /// If `index >= Self::lanes()` the behavior is undefined.
30 #[inline]
31 @@ -611,7 +611,7 @@ macro_rules! impl_minimal_p {
32
33 /// Instantiates a new vector with the values of the `slice`.
34 ///
35 - /// # Precondition
36 + /// # Safety
37 ///
38 /// If `slice.len() < Self::lanes()` or `&slice[0]` is not aligned
39 /// to an `align_of::<Self>()` boundary, the behavior is undefined.
40 @@ -624,7 +624,7 @@ macro_rules! impl_minimal_p {
41
42 /// Instantiates a new vector with the values of the `slice`.
43 ///
44 - /// # Precondition
45 + /// # Safety
46 ///
47 /// If `slice.len() < Self::lanes()` the behavior is undefined.
48 #[inline]
49 @@ -827,7 +827,7 @@ macro_rules! impl_minimal_p {
50
51 /// Writes the values of the vector to the `slice`.
52 ///
53 - /// # Precondition
54 + /// # Safety
55 ///
56 /// If `slice.len() < Self::lanes()` or `&slice[0]` is not
57 /// aligned to an `align_of::<Self>()` boundary, the behavior is
58 @@ -843,7 +843,7 @@ macro_rules! impl_minimal_p {
59
60 /// Writes the values of the vector to the `slice`.
61 ///
62 - /// # Precondition
63 + /// # Safety
64 ///
65 /// If `slice.len() < Self::lanes()` the behavior is undefined.
66 #[inline]
67 @@ -1151,7 +1151,7 @@ macro_rules! impl_minimal_p {
68 /// As such, memory acquired directly from allocators or memory
69 /// mapped files may be too large to handle with this function.
70 ///
71 - /// Consider using wrapping_offset_from instead if these constraints
72 + /// Consider using `wrapping_offset_from` instead if these constraints
73 /// are difficult to satisfy. The only advantage of this method is
74 /// that it enables more aggressive compiler optimizations.
75 #[inline]
76 Index: rust-packed-simd-0.3.3/src/lib.rs
77 ===================================================================
78 --- rust-packed-simd-0.3.3.orig/src/lib.rs
79 +++ rust-packed-simd-0.3.3/src/lib.rs
80 @@ -216,6 +216,8 @@
81 clippy::cast_lossless,
82 clippy::cast_possible_wrap,
83 clippy::cast_precision_loss,
84 + // TODO: manually add the `#[must_use]` attribute where appropiate
85 + clippy::must_use_candidate,
86 // This lint is currently broken for generic code
87 // See https://github.com/rust-lang/rust-clippy/issues/3410
88 clippy::use_self
0 commit 76916f1a8518540b90063832ace546d5efdb13ca
1 Author: Jubilee Young <workingjubilee@gmail.com>
2 Date: Sat May 15 20:39:43 2021 -0700
3
4 Let packed_simd to be sloppy
5
6 diff --git a/.travis.yml b/.travis.yml
7 index 011eddde0..0ffc06afd 100644
8 --- a/.travis.yml
9 +++ b/.travis.yml
10 @@ -173,12 +173,6 @@ jobs:
11 rustup toolchain install nightly -c rustfmt --allow-downgrade
12 ci/all.sh check_fmt || true
13 stage: tools
14 - - name: "clippy"
15 - install: true
16 - script: |
17 - rustup component add clippy
18 - ci/all.sh clippy
19 - stage: tools
20
21 allow_failures:
22 # FIXME: ISPC cannot be found?
23 diff --git a/examples/Cargo.toml b/examples/Cargo.toml
24 index 681326351..b05d4b22b 100644
25 --- a/examples/Cargo.toml
26 +++ b/examples/Cargo.toml
27 @@ -1,3 +1,6 @@
28 +# FIXME: Many members of this workspace, including aobench, mandelbrot, and stencil,
29 +# currently trigger a "null pointer deref" warning.
30 +# This is likely due to unsoundness inside packed_simd.
31 [workspace]
32 members = [
33 "aobench",
34 diff --git a/examples/aobench/src/lib.rs b/examples/aobench/src/lib.rs
35 index 7fc7f9bda..d6bbb4cf5 100644
36 --- a/examples/aobench/src/lib.rs
37 +++ b/examples/aobench/src/lib.rs
38 @@ -2,7 +2,9 @@
39 //!
40 //! Based on [aobench](https://code.google.com/archive/p/aobench/) by Syoyo
41 //! Fujita.
42 -#![deny(warnings, rust_2018_idioms)]
43 +// FIXME: Null pointer deref warning triggered in this example,
44 +// likely inside a macro expansion deriving from packed_simd.
45 +#![deny(rust_2018_idioms)]
46 #![allow(non_snake_case, non_camel_case_types)]
47 #![allow(
48 clippy::many_single_char_names,
49 diff --git a/examples/aobench/src/main.rs b/examples/aobench/src/main.rs
50 index 3dd5ec88b..9dbb1f467 100644
51 --- a/examples/aobench/src/main.rs
52 +++ b/examples/aobench/src/main.rs
53 @@ -2,7 +2,7 @@
54 //!
55 //! Based on [aobench](https://code.google.com/archive/p/aobench/) by Syoyo
56 //! Fujita.
57 -#![deny(warnings, rust_2018_idioms)]
58 +#![deny(rust_2018_idioms)]
59
60 use aobench_lib::*;
61 use std::path::PathBuf;
62 diff --git a/examples/dot_product/src/lib.rs b/examples/dot_product/src/lib.rs
63 index 7f053a8f3..77d170c0d 100644
64 --- a/examples/dot_product/src/lib.rs
65 +++ b/examples/dot_product/src/lib.rs
66 @@ -1,5 +1,5 @@
67 //! Vector dot product
68 -#![deny(warnings, rust_2018_idioms)]
69 +#![deny(rust_2018_idioms)]
70 #![feature(custom_inner_attributes)]
71 #![allow(clippy::must_use_candidate, clippy::float_cmp)]
72
73 diff --git a/examples/fannkuch_redux/src/main.rs b/examples/fannkuch_redux/src/main.rs
74 index 912b4d66b..24cdec49f 100644
75 --- a/examples/fannkuch_redux/src/main.rs
76 +++ b/examples/fannkuch_redux/src/main.rs
77 @@ -1,4 +1,4 @@
78 -#![deny(warnings, rust_2018_idioms)]
79 +#![deny(rust_2018_idioms)]
80
81 use fannkuch_redux_lib::*;
82
83 diff --git a/examples/mandelbrot/src/lib.rs b/examples/mandelbrot/src/lib.rs
84 index 581fd02ca..196edc8b0 100644
85 --- a/examples/mandelbrot/src/lib.rs
86 +++ b/examples/mandelbrot/src/lib.rs
87 @@ -2,7 +2,9 @@
88 //!
89 //! [bg]: https://benchmarksgame-team.pages.debian.net/benchmarksgame/description/mandelbrot.html#mandelbrot
90
91 -#![deny(warnings, rust_2018_idioms)]
92 +// FIXME: Null pointer deref warning triggered in this example,
93 +// likely inside a macro expansion deriving from packed_simd.
94 +#![deny(rust_2018_idioms)]
95 #![allow(
96 clippy::cast_precision_loss,
97 clippy::cast_sign_loss,
98 diff --git a/examples/mandelbrot/src/main.rs b/examples/mandelbrot/src/main.rs
99 index 6f82f05ac..7bee4a2f7 100644
100 --- a/examples/mandelbrot/src/main.rs
101 +++ b/examples/mandelbrot/src/main.rs
102 @@ -2,7 +2,7 @@
103 //!
104 //! [bg]: https://benchmarksgame-team.pages.debian.net/benchmarksgame/description/mandelbrot.html#mandelbrot
105
106 -#![deny(warnings, rust_2018_idioms)]
107 +#![deny(rust_2018_idioms)]
108
109 use mandelbrot_lib::*;
110 use std::io;
111 diff --git a/examples/matrix_inverse/src/lib.rs b/examples/matrix_inverse/src/lib.rs
112 index 1f9bab3f8..fc3dbe210 100644
113 --- a/examples/matrix_inverse/src/lib.rs
114 +++ b/examples/matrix_inverse/src/lib.rs
115 @@ -1,6 +1,6 @@
116 //! 4x4 matrix inverse
117 #![feature(custom_inner_attributes)]
118 -#![deny(warnings, rust_2018_idioms)]
119 +#![deny(rust_2018_idioms)]
120 #![allow(clippy::must_use_candidate)]
121
122 pub mod scalar;
123 diff --git a/examples/nbody/src/lib.rs b/examples/nbody/src/lib.rs
124 index d15854d5d..87c08b79c 100644
125 --- a/examples/nbody/src/lib.rs
126 +++ b/examples/nbody/src/lib.rs
127 @@ -1,7 +1,7 @@
128 //! The N-body benchmark from the [benchmarks game][bg].
129 //!
130 //! [bg]: https://benchmarksgame-team.pages.debian.net/benchmarksgame/description/nbody.html#nbody
131 -#![deny(warnings, rust_2018_idioms)]
132 +#![deny(rust_2018_idioms)]
133 #![allow(
134 clippy::similar_names,
135 clippy::excessive_precision,
136 diff --git a/examples/nbody/src/main.rs b/examples/nbody/src/main.rs
137 index 3f53b2fe5..c5bc128eb 100644
138 --- a/examples/nbody/src/main.rs
139 +++ b/examples/nbody/src/main.rs
140 @@ -1,7 +1,7 @@
141 //! The N-body benchmark from the [benchmarks game][bg].
142 //!
143 //! [bg]: https://benchmarksgame-team.pages.debian.net/benchmarksgame/description/nbody.html#nbody
144 -#![deny(warnings, rust_2018_idioms)]
145 +#![deny(rust_2018_idioms)]
146
147 fn run<O: std::io::Write>(o: &mut O, n: usize, alg: usize) {
148 let (energy_before, energy_after) = nbody_lib::run(n, alg);
149 diff --git a/examples/options_pricing/src/lib.rs b/examples/options_pricing/src/lib.rs
150 index 138249909..86f5f0248 100644
151 --- a/examples/options_pricing/src/lib.rs
152 +++ b/examples/options_pricing/src/lib.rs
153 @@ -1,4 +1,4 @@
154 -#![deny(warnings, rust_2018_idioms)]
155 +#![deny(rust_2018_idioms)]
156 #![allow(
157 clippy::inline_always,
158 clippy::many_single_char_names,
159 diff --git a/examples/slice_sum/src/main.rs b/examples/slice_sum/src/main.rs
160 index 18b3692aa..2b3e440ad 100644
161 --- a/examples/slice_sum/src/main.rs
162 +++ b/examples/slice_sum/src/main.rs
163 @@ -1,4 +1,4 @@
164 -#![deny(warnings, rust_2018_idioms)]
165 +#![deny(rust_2018_idioms)]
166
167 use packed_simd::f32x8 as f32s;
168 use std::{mem, slice};
169 diff --git a/examples/spectral_norm/src/lib.rs b/examples/spectral_norm/src/lib.rs
170 index 1134fb0b6..dac35341d 100644
171 --- a/examples/spectral_norm/src/lib.rs
172 +++ b/examples/spectral_norm/src/lib.rs
173 @@ -1,5 +1,5 @@
174 //! Spectral Norm
175 -#![deny(warnings, rust_2018_idioms)]
176 +#![deny(rust_2018_idioms)]
177 #![allow(non_snake_case, non_camel_case_types)]
178 #![allow(
179 clippy::cast_precision_loss,
180 diff --git a/examples/spectral_norm/src/main.rs b/examples/spectral_norm/src/main.rs
181 index d16e6de99..7bbdf7cbf 100644
182 --- a/examples/spectral_norm/src/main.rs
183 +++ b/examples/spectral_norm/src/main.rs
184 @@ -1,5 +1,3 @@
185 -#![deny(warnings)]
186 -
187 extern crate spectral_norm_lib;
188 use spectral_norm_lib::*;
189
190 diff --git a/examples/stencil/src/lib.rs b/examples/stencil/src/lib.rs
191 index b922bc14f..1d7aeb40d 100644
192 --- a/examples/stencil/src/lib.rs
193 +++ b/examples/stencil/src/lib.rs
194 @@ -1,5 +1,7 @@
195 #![feature(custom_inner_attributes, stmt_expr_attributes)]
196 -#![deny(warnings, rust_2018_idioms)]
197 +// FIXME: Null pointer deref warning triggered in this example,
198 +// likely inside a macro expansion deriving from packed_simd.
199 +#![deny(rust_2018_idioms)]
200 #![allow(
201 clippy::similar_names,
202 clippy::cast_precision_loss,
203 diff --git a/micro_benchmarks/benches/mask_reductions.rs b/micro_benchmarks/benches/mask_reductions.rs
204 index e0b43a993..7d7ade52b 100644
205 --- a/micro_benchmarks/benches/mask_reductions.rs
206 +++ b/micro_benchmarks/benches/mask_reductions.rs
207 @@ -1,5 +1,5 @@
208 //! Benchmarks for the mask reductions `all`, `any`, and `none`.
209 -#![deny(warnings, rust_2018_idioms)]
210 +#![deny(rust_2018_idioms)]
211 #![feature(test)]
212
213 use packed_simd::*;
214 diff --git a/verify/verify/src/lib.rs b/verify/verify/src/lib.rs
215 index ad87e56cd..b222c88f1 100644
216 --- a/verify/verify/src/lib.rs
217 +++ b/verify/verify/src/lib.rs
218 @@ -1,7 +1,7 @@
219 // FIXME: these types are unsound in C FFI already
220 // See https://github.com/rust-lang/rust/issues/53346
221 #![allow(improper_ctypes_definitions)]
222 -#![deny(warnings, rust_2018_idioms)]
223 +#![deny(rust_2018_idioms)]
224 #![cfg_attr(test, feature(avx512_target_feature, abi_vectorcall, llvm_asm))]
225
226 #[cfg(test)]
0 commit a8273dd9900075f8d8fc5a583d2f1c4b1a0b5b14
1 Author: ecstatic-morse <ecstaticmorse@gmail.com>
2 Date: Thu Feb 20 13:42:30 2020 -0800
3
4 Mark `simd_shuffle` intrinsics as `rustc_args_required_const`
5
6 This change was made in `stdarch` but not `packed_simd`. See rust-lang/rust#69280 for background.
7
8 diff --git a/src/codegen/llvm.rs b/src/codegen/llvm.rs
9 index 6ee30c590..93c6ce6b7 100644
10 --- a/src/codegen/llvm.rs
11 +++ b/src/codegen/llvm.rs
12 @@ -10,31 +10,37 @@ extern "platform-intrinsic" {
13 // FIXME: Passing this intrinsics an `idx` array with an index that is
14 // out-of-bounds will produce a monomorphization-time error.
15 // https://github.com/rust-lang-nursery/packed_simd/issues/21
16 + #[rustc_args_required_const(2)]
17 pub fn simd_shuffle2<T, U>(x: T, y: T, idx: [u32; 2]) -> U
18 where
19 T: Simd,
20 <T as Simd>::Element: Shuffle<[u32; 2], Output = U>;
21
22 + #[rustc_args_required_const(2)]
23 pub fn simd_shuffle4<T, U>(x: T, y: T, idx: [u32; 4]) -> U
24 where
25 T: Simd,
26 <T as Simd>::Element: Shuffle<[u32; 4], Output = U>;
27
28 + #[rustc_args_required_const(2)]
29 pub fn simd_shuffle8<T, U>(x: T, y: T, idx: [u32; 8]) -> U
30 where
31 T: Simd,
32 <T as Simd>::Element: Shuffle<[u32; 8], Output = U>;
33
34 + #[rustc_args_required_const(2)]
35 pub fn simd_shuffle16<T, U>(x: T, y: T, idx: [u32; 16]) -> U
36 where
37 T: Simd,
38 <T as Simd>::Element: Shuffle<[u32; 16], Output = U>;
39
40 + #[rustc_args_required_const(2)]
41 pub fn simd_shuffle32<T, U>(x: T, y: T, idx: [u32; 32]) -> U
42 where
43 T: Simd,
44 <T as Simd>::Element: Shuffle<[u32; 32], Output = U>;
45
46 + #[rustc_args_required_const(2)]
47 pub fn simd_shuffle64<T, U>(x: T, y: T, idx: [u32; 64]) -> U
48 where
49 T: Simd,
0 This patch is based on the upstream commit below, adjusted for
1 the Debian package. It is mainly applied to clear the way for
2 later patches, not because it's likely to be useful in itself
3
4 commit f421eefd3444ef1d314e9af5b052e05fb3bdebd9
5 Author: Jubilee <46493976+workingjubilee@users.noreply.github.com>
6 Date: Sat Sep 26 14:27:55 2020 -0700
7
8 Rebuild CI stages (#295)
9
10 Rebuilds CI into a set of stages that indicates first the "totally
11 supported" stage, marked "build-test-verify", then groups arches
12 by base pointer width and tier. This surfaces all targets which
13 currently have full expected functionality, so as to better identify
14 and limit future regressions.
15
16 - Allow improper ctypes in project to quash spurious CI error
17 - Remove Intel SDE, as the Dockerfile is broken.
18 - Use recent LTS Ubuntu in CI
19 - Fix deprecation warnings for .travis.yml
20 - Allow inlining failure on 32-bit platforms
21 - Always test aarch64 with Neon
22 - Move promising platforms to build-test-verify
23 - Drop tier 3 targets
24 - Reduce repetitive SSE2 -> SSE4 tests
25 - Allow aarch64-apple-ios + Neon test failure
26
27 Index: rust-packed-simd-0.3.3/src/lib.rs
28 ===================================================================
29 --- rust-packed-simd-0.3.3.orig/src/lib.rs
30 +++ rust-packed-simd-0.3.3/src/lib.rs
31 @@ -212,16 +212,19 @@
32 custom_inner_attributes
33 )]
34 #![allow(non_camel_case_types, non_snake_case,
35 - clippy::cast_possible_truncation,
36 - clippy::cast_lossless,
37 - clippy::cast_possible_wrap,
38 - clippy::cast_precision_loss,
39 - // TODO: manually add the `#[must_use]` attribute where appropiate
40 - clippy::must_use_candidate,
41 - // This lint is currently broken for generic code
42 - // See https://github.com/rust-lang/rust-clippy/issues/3410
43 - clippy::use_self,
44 - clippy::wrong_self_convention
45 + // FIXME: these types are unsound in C FFI already
46 + // See https://github.com/rust-lang/rust/issues/53346
47 + improper_ctypes_definitions,
48 + clippy::cast_possible_truncation,
49 + clippy::cast_lossless,
50 + clippy::cast_possible_wrap,
51 + clippy::cast_precision_loss,
52 + // TODO: manually add the `#[must_use]` attribute where appropriate
53 + clippy::must_use_candidate,
54 + // This lint is currently broken for generic code
55 + // See https://github.com/rust-lang/rust-clippy/issues/3410
56 + clippy::use_self,
57 + clippy::wrong_self_convention,
58 )]
59 #![cfg_attr(test, feature(hashmap_internals))]
60 #![deny(warnings, rust_2018_idioms, clippy::missing_inline_in_public_items)]
0 Patch based on the upstream commit described below, adjusted to apply to the
1 Debian package by Peter Michael Green.
2
3 commit 58ba720df859b8d8a4c685a7984266e6f237b75e
4 Author: Yuki Okushi <jtitor@2k36.org>
5 Date: Wed May 12 11:47:06 2021 +0900
6
7 Remove unnecessary the `const_fn` feature gate
8
9 diff --git a/src/lib.rs b/src/lib.rs
10 index 1508086ff..2baeef375 100644
11 --- a/src/lib.rs
12 +++ b/src/lib.rs
13 @@ -216,6 +216,5 @@
14 #![feature(
15 repr_simd,
16 - const_fn,
17 platform_intrinsics,
18 stdsimd,
19 aarch64_target_feature,
0 This patch is based on the upstream commit described below, modified to
1 remove fuzz.
2
3 commit 45d5347a0d2187c046a546a477d2a53111cd7713
4 Author: Yuki Okushi <yuki.okushi@huawei.com>
5 Date: Sat Sep 4 07:01:42 2021 +0900
6
7 Rename `const_generics` feature gate to `adt_const_params`
8
9 Index: rust-packed-simd-0.3.3/src/lib.rs
10 ===================================================================
11 --- rust-packed-simd-0.3.3.orig/src/lib.rs
12 +++ rust-packed-simd-0.3.3/src/lib.rs
13 @@ -200,7 +200,7 @@
14 //! preserving, etc.
15
16 #![feature(
17 - const_generics,
18 + adt_const_params,
19 repr_simd,
20 platform_intrinsics,
21 stdsimd,
22 Remove-__m64-type.diff
33 Remove-x86_m8x8_sse_impl-macro.diff
44 drop-features.diff
5 remove-const-fn-gate.diff
6 mark-simd-shuffle-intrinsics.diff
7 fix-clippy-issues.diff
8 fix-more-clippy-lints.diff
9 fix-clippy-for-main-crate.diff
10 rebuild-ci-stages.diff
11 update-shuffle-api-for-const-generics.diff
12 rename-const-generics-gate-to-adt-const-params.diff
0 This patch is based on the upstream commit described below, adjusted to
1 remove fuzz when applying to the Debian package.
2
3 commit 728d47506fe3a2599818060bd6e02e4bd3e338d5
4 Author: Jubilee Young <workingjubilee@gmail.com>
5 Date: Sat May 15 20:15:42 2021 -0700
6
7 Update shuffle API for const generics
8
9 Index: rust-packed-simd-0.3.3/src/api/shuffle.rs
10 ===================================================================
11 --- rust-packed-simd-0.3.3.orig/src/api/shuffle.rs
12 +++ rust-packed-simd-0.3.3/src/api/shuffle.rs
13 @@ -79,20 +79,18 @@ macro_rules! shuffle {
14 ($vec0:expr, $vec1:expr, [$l0:expr, $l1:expr]) => {{
15 #[allow(unused_unsafe)]
16 unsafe {
17 - $crate::Simd($crate::__shuffle_vector2(
18 + $crate::Simd($crate::__shuffle_vector2::<{[$l0, $l1]}, _, _>(
19 $vec0.0,
20 $vec1.0,
21 - [$l0, $l1],
22 ))
23 }
24 }};
25 ($vec0:expr, $vec1:expr, [$l0:expr, $l1:expr, $l2:expr, $l3:expr]) => {{
26 #[allow(unused_unsafe)]
27 unsafe {
28 - $crate::Simd($crate::__shuffle_vector4(
29 + $crate::Simd($crate::__shuffle_vector4::<{[$l0, $l1, $l2, $l3]}, _, _>(
30 $vec0.0,
31 $vec1.0,
32 - [$l0, $l1, $l2, $l3],
33 ))
34 }
35 }};
36 @@ -101,10 +99,9 @@ macro_rules! shuffle {
37 $l4:expr, $l5:expr, $l6:expr, $l7:expr]) => {{
38 #[allow(unused_unsafe)]
39 unsafe {
40 - $crate::Simd($crate::__shuffle_vector8(
41 + $crate::Simd($crate::__shuffle_vector8::<{[$l0, $l1, $l2, $l3, $l4, $l5, $l6, $l7]}, _, _>(
42 $vec0.0,
43 $vec1.0,
44 - [$l0, $l1, $l2, $l3, $l4, $l5, $l6, $l7],
45 ))
46 }
47 }};
48 @@ -115,13 +112,14 @@ macro_rules! shuffle {
49 $l12:expr, $l13:expr, $l14:expr, $l15:expr]) => {{
50 #[allow(unused_unsafe)]
51 unsafe {
52 - $crate::Simd($crate::__shuffle_vector16(
53 - $vec0.0,
54 - $vec1.0,
55 + $crate::Simd($crate::__shuffle_vector16::<{
56 [
57 $l0, $l1, $l2, $l3, $l4, $l5, $l6, $l7, $l8, $l9, $l10,
58 $l11, $l12, $l13, $l14, $l15,
59 - ],
60 + ]
61 + }, _, _>(
62 + $vec0.0,
63 + $vec1.0,
64 ))
65 }
66 }};
67 @@ -136,15 +134,16 @@ macro_rules! shuffle {
68 $l28:expr, $l29:expr, $l30:expr, $l31:expr]) => {{
69 #[allow(unused_unsafe)]
70 unsafe {
71 - $crate::Simd($crate::__shuffle_vector32(
72 - $vec0.0,
73 - $vec1.0,
74 + $crate::Simd($crate::__shuffle_vector32::<{
75 [
76 $l0, $l1, $l2, $l3, $l4, $l5, $l6, $l7, $l8, $l9, $l10,
77 $l11, $l12, $l13, $l14, $l15, $l16, $l17, $l18, $l19,
78 $l20, $l21, $l22, $l23, $l24, $l25, $l26, $l27, $l28,
79 $l29, $l30, $l31,
80 - ],
81 + ]
82 + }, _, _>(
83 + $vec0.0,
84 + $vec1.0,
85 ))
86 }
87 }};
88 @@ -167,18 +166,17 @@ macro_rules! shuffle {
89 $l60:expr, $l61:expr, $l62:expr, $l63:expr]) => {{
90 #[allow(unused_unsafe)]
91 unsafe {
92 - $crate::Simd($crate::__shuffle_vector64(
93 + $crate::Simd($crate::__shuffle_vector64::<{[
94 + $l0, $l1, $l2, $l3, $l4, $l5, $l6, $l7, $l8, $l9, $l10,
95 + $l11, $l12, $l13, $l14, $l15, $l16, $l17, $l18, $l19,
96 + $l20, $l21, $l22, $l23, $l24, $l25, $l26, $l27, $l28,
97 + $l29, $l30, $l31, $l32, $l33, $l34, $l35, $l36, $l37,
98 + $l38, $l39, $l40, $l41, $l42, $l43, $l44, $l45, $l46,
99 + $l47, $l48, $l49, $l50, $l51, $l52, $l53, $l54, $l55,
100 + $l56, $l57, $l58, $l59, $l60, $l61, $l62, $l63,
101 + ]}, _, _>(
102 $vec0.0,
103 $vec1.0,
104 - [
105 - $l0, $l1, $l2, $l3, $l4, $l5, $l6, $l7, $l8, $l9, $l10,
106 - $l11, $l12, $l13, $l14, $l15, $l16, $l17, $l18, $l19,
107 - $l20, $l21, $l22, $l23, $l24, $l25, $l26, $l27, $l28,
108 - $l29, $l30, $l31, $l32, $l33, $l34, $l35, $l36, $l37,
109 - $l38, $l39, $l40, $l41, $l42, $l43, $l44, $l45, $l46,
110 - $l47, $l48, $l49, $l50, $l51, $l52, $l53, $l54, $l55,
111 - $l56, $l57, $l58, $l59, $l60, $l61, $l62, $l63,
112 - ],
113 ))
114 }
115 }};
116 Index: rust-packed-simd-0.3.3/src/codegen/llvm.rs
117 ===================================================================
118 --- rust-packed-simd-0.3.3.orig/src/codegen/llvm.rs
119 +++ rust-packed-simd-0.3.3/src/codegen/llvm.rs
120 @@ -7,52 +7,73 @@ use crate::sealed::Simd;
121
122 // Shuffle intrinsics: expanded in users' crates, therefore public.
123 extern "platform-intrinsic" {
124 - // FIXME: Passing this intrinsics an `idx` array with an index that is
125 - // out-of-bounds will produce a monomorphization-time error.
126 - // https://github.com/rust-lang-nursery/packed_simd/issues/21
127 - #[rustc_args_required_const(2)]
128 - pub fn simd_shuffle2<T, U>(x: T, y: T, idx: [u32; 2]) -> U
129 - where
130 - T: Simd,
131 - <T as Simd>::Element: Shuffle<[u32; 2], Output = U>;
132 -
133 - #[rustc_args_required_const(2)]
134 - pub fn simd_shuffle4<T, U>(x: T, y: T, idx: [u32; 4]) -> U
135 - where
136 - T: Simd,
137 - <T as Simd>::Element: Shuffle<[u32; 4], Output = U>;
138 -
139 - #[rustc_args_required_const(2)]
140 - pub fn simd_shuffle8<T, U>(x: T, y: T, idx: [u32; 8]) -> U
141 - where
142 - T: Simd,
143 - <T as Simd>::Element: Shuffle<[u32; 8], Output = U>;
144 -
145 - #[rustc_args_required_const(2)]
146 - pub fn simd_shuffle16<T, U>(x: T, y: T, idx: [u32; 16]) -> U
147 - where
148 - T: Simd,
149 - <T as Simd>::Element: Shuffle<[u32; 16], Output = U>;
150 -
151 - #[rustc_args_required_const(2)]
152 - pub fn simd_shuffle32<T, U>(x: T, y: T, idx: [u32; 32]) -> U
153 - where
154 - T: Simd,
155 - <T as Simd>::Element: Shuffle<[u32; 32], Output = U>;
156 -
157 - #[rustc_args_required_const(2)]
158 - pub fn simd_shuffle64<T, U>(x: T, y: T, idx: [u32; 64]) -> U
159 - where
160 - T: Simd,
161 - <T as Simd>::Element: Shuffle<[u32; 64], Output = U>;
162 -}
163 -
164 -pub use self::simd_shuffle16 as __shuffle_vector16;
165 -pub use self::simd_shuffle2 as __shuffle_vector2;
166 -pub use self::simd_shuffle32 as __shuffle_vector32;
167 -pub use self::simd_shuffle4 as __shuffle_vector4;
168 -pub use self::simd_shuffle64 as __shuffle_vector64;
169 -pub use self::simd_shuffle8 as __shuffle_vector8;
170 + pub fn simd_shuffle2<T, U>(x: T, y: T, idx: [u32; 2]) -> U;
171 + pub fn simd_shuffle4<T, U>(x: T, y: T, idx: [u32; 4]) -> U;
172 + pub fn simd_shuffle8<T, U>(x: T, y: T, idx: [u32; 8]) -> U;
173 + pub fn simd_shuffle16<T, U>(x: T, y: T, idx: [u32; 16]) -> U;
174 + pub fn simd_shuffle32<T, U>(x: T, y: T, idx: [u32; 32]) -> U;
175 + pub fn simd_shuffle64<T, U>(x: T, y: T, idx: [u32; 64]) -> U;
176 +}
177 +
178 +#[allow(clippy::missing_safety_doc)]
179 +#[inline]
180 +pub unsafe fn __shuffle_vector2<const IDX: [u32; 2], T, U>(x: T, y: T) -> U
181 +where
182 + T: Simd,
183 + <T as Simd>::Element: Shuffle<[u32; 2], Output = U>,
184 +{
185 + simd_shuffle2(x, y, IDX)
186 +}
187 +
188 +#[allow(clippy::missing_safety_doc)]
189 +#[inline]
190 +pub unsafe fn __shuffle_vector4<const IDX: [u32; 4], T, U>(x: T, y: T) -> U
191 +where
192 + T: Simd,
193 + <T as Simd>::Element: Shuffle<[u32; 4], Output = U>,
194 +{
195 + simd_shuffle4(x, y, IDX)
196 +}
197 +
198 +#[allow(clippy::missing_safety_doc)]
199 +#[inline]
200 +pub unsafe fn __shuffle_vector8<const IDX: [u32; 8], T, U>(x: T, y: T) -> U
201 +where
202 + T: Simd,
203 + <T as Simd>::Element: Shuffle<[u32; 8], Output = U>,
204 +{
205 + simd_shuffle8(x, y, IDX)
206 +}
207 +
208 +#[allow(clippy::missing_safety_doc)]
209 +#[inline]
210 +pub unsafe fn __shuffle_vector16<const IDX: [u32; 16], T, U>(x: T, y: T) -> U
211 +where
212 + T: Simd,
213 + <T as Simd>::Element: Shuffle<[u32; 16], Output = U>,
214 +{
215 + simd_shuffle16(x, y, IDX)
216 +}
217 +
218 +#[allow(clippy::missing_safety_doc)]
219 +#[inline]
220 +pub unsafe fn __shuffle_vector32<const IDX: [u32; 32], T, U>(x: T, y: T) -> U
221 +where
222 + T: Simd,
223 + <T as Simd>::Element: Shuffle<[u32; 32], Output = U>,
224 +{
225 + simd_shuffle32(x, y, IDX)
226 +}
227 +
228 +#[allow(clippy::missing_safety_doc)]
229 +#[inline]
230 +pub unsafe fn __shuffle_vector64<const IDX: [u32; 64], T, U>(x: T, y: T) -> U
231 +where
232 + T: Simd,
233 + <T as Simd>::Element: Shuffle<[u32; 64], Output = U>,
234 +{
235 + simd_shuffle64(x, y, IDX)
236 +}
237
238 extern "platform-intrinsic" {
239 crate fn simd_eq<T, U>(x: T, y: T) -> U;
240 Index: rust-packed-simd-0.3.3/src/lib.rs
241 ===================================================================
242 --- rust-packed-simd-0.3.3.orig/src/lib.rs
243 +++ rust-packed-simd-0.3.3/src/lib.rs
244 @@ -200,6 +200,7 @@
245 //! preserving, etc.
246
247 #![feature(
248 + const_generics,
249 repr_simd,
250 platform_intrinsics,
251 stdsimd,
252 @@ -215,6 +216,7 @@
253 // FIXME: these types are unsound in C FFI already
254 // See https://github.com/rust-lang/rust/issues/53346
255 improper_ctypes_definitions,
256 + incomplete_features,
257 clippy::cast_possible_truncation,
258 clippy::cast_lossless,
259 clippy::cast_possible_wrap,
260 @@ -225,6 +227,7 @@
261 // See https://github.com/rust-lang/rust-clippy/issues/3410
262 clippy::use_self,
263 clippy::wrong_self_convention,
264 + clippy::from_over_into,
265 )]
266 #![cfg_attr(test, feature(hashmap_internals))]
267 #![deny(warnings, rust_2018_idioms, clippy::missing_inline_in_public_items)]