158158#![ deny(
159159 anonymous_parameters,
160160 deprecated_in_future,
161- illegal_floating_point_literal_pattern,
162161 late_bound_lifetime_arguments,
163162 missing_copy_implementations,
164163 missing_debug_implementations,
228227 clippy:: indexing_slicing,
229228) ) ]
230229#![ cfg_attr( not( test) , no_std) ]
231- #![ cfg_attr( feature = "simd-nightly" , feature( stdsimd) ) ]
230+ #![ cfg_attr(
231+ all( feature = "simd-nightly" , any( target_arch = "x86" , target_arch = "x86_64" ) ) ,
232+ feature( stdarch_x86_avx512)
233+ ) ]
234+ #![ cfg_attr(
235+ all( feature = "simd-nightly" , target_arch = "arm" ) ,
236+ feature( stdarch_arm_dsp, stdarch_arm_neon_intrinsics)
237+ ) ]
238+ #![ cfg_attr(
239+ all( feature = "simd-nightly" , any( target_arch = "powerpc" , target_arch = "powerpc64" ) ) ,
240+ feature( stdarch_powerpc)
241+ ) ]
232242#![ cfg_attr( doc_cfg, feature( doc_cfg) ) ]
233243#![ cfg_attr(
234244 __INTERNAL_USE_ONLY_NIGHLTY_FEATURES_IN_TESTS,
@@ -5126,9 +5136,7 @@ mod sealed {
51265136 not( feature = "alloc" ) ,
51275137 doc = "[`Vec<u8>`]: https://doc.rust-lang.org/std/vec/struct.Vec.html"
51285138) ]
5129- pub unsafe trait ByteSlice :
5130- Deref < Target = [ u8 ] > + Sized + self :: sealed:: ByteSliceSealed
5131- {
5139+ pub unsafe trait ByteSlice : Deref < Target = [ u8 ] > + Sized + sealed:: ByteSliceSealed {
51325140 /// Are the [`Ref::into_ref`] and [`Ref::into_mut`] methods sound when used
51335141 /// with `Self`? If not, evaluating this constant must panic at compile
51345142 /// time.
@@ -5702,12 +5710,14 @@ mod tests {
57025710 #[ test]
57035711 #[ cfg_attr( miri, ignore) ]
57045712 fn testvalidate_cast_and_convert_metadata ( ) {
5713+ #[ allow( non_local_definitions) ]
57055714 impl From < usize > for SizeInfo {
57065715 fn from ( _size : usize ) -> SizeInfo {
57075716 SizeInfo :: Sized { _size }
57085717 }
57095718 }
57105719
5720+ #[ allow( non_local_definitions) ]
57115721 impl From < ( usize , usize ) > for SizeInfo {
57125722 fn from ( ( _offset, _elem_size) : ( usize , usize ) ) -> SizeInfo {
57135723 SizeInfo :: SliceDst ( TrailingSliceLayout { _offset, _elem_size } )
@@ -6413,6 +6423,7 @@ mod tests {
64136423 // | `repr(C)`? | generic? | `KnownLayout`? | `Sized`? | Type Name |
64146424 // | N | N | N | Y | KL01 |
64156425 #[ derive( KnownLayout ) ]
6426+ #[ allow( dead_code) ] // fields are never read
64166427 struct KL01 ( NotKnownLayout < AU32 > , NotKnownLayout < AU16 > ) ;
64176428
64186429 let expected = DstLayout :: for_type :: < KL01 > ( ) ;
@@ -6423,6 +6434,7 @@ mod tests {
64236434 // ...with `align(N)`:
64246435 #[ derive( KnownLayout ) ]
64256436 #[ repr( align( 64 ) ) ]
6437+ #[ allow( dead_code) ] // fields are never read
64266438 struct KL01Align ( NotKnownLayout < AU32 > , NotKnownLayout < AU16 > ) ;
64276439
64286440 let expected = DstLayout :: for_type :: < KL01Align > ( ) ;
@@ -6433,6 +6445,7 @@ mod tests {
64336445 // ...with `packed`:
64346446 #[ derive( KnownLayout ) ]
64356447 #[ repr( packed) ]
6448+ #[ allow( dead_code) ] // fields are never read
64366449 struct KL01Packed ( NotKnownLayout < AU32 > , NotKnownLayout < AU16 > ) ;
64376450
64386451 let expected = DstLayout :: for_type :: < KL01Packed > ( ) ;
@@ -6443,6 +6456,7 @@ mod tests {
64436456 // ...with `packed(N)`:
64446457 #[ derive( KnownLayout ) ]
64456458 #[ repr( packed( 2 ) ) ]
6459+ #[ allow( dead_code) ] // fields are never read
64466460 struct KL01PackedN ( NotKnownLayout < AU32 > , NotKnownLayout < AU16 > ) ;
64476461
64486462 assert_impl_all ! ( KL01PackedN : KnownLayout ) ;
@@ -6455,6 +6469,7 @@ mod tests {
64556469 // | `repr(C)`? | generic? | `KnownLayout`? | `Sized`? | Type Name |
64566470 // | N | N | Y | Y | KL03 |
64576471 #[ derive( KnownLayout ) ]
6472+ #[ allow( dead_code) ] // fields are never read
64586473 struct KL03 ( NotKnownLayout , u8 ) ;
64596474
64606475 let expected = DstLayout :: for_type :: < KL03 > ( ) ;
@@ -6465,6 +6480,7 @@ mod tests {
64656480 // ... with `align(N)`
64666481 #[ derive( KnownLayout ) ]
64676482 #[ repr( align( 64 ) ) ]
6483+ #[ allow( dead_code) ] // fields are never read
64686484 struct KL03Align ( NotKnownLayout < AU32 > , u8 ) ;
64696485
64706486 let expected = DstLayout :: for_type :: < KL03Align > ( ) ;
@@ -6475,6 +6491,7 @@ mod tests {
64756491 // ... with `packed`:
64766492 #[ derive( KnownLayout ) ]
64776493 #[ repr( packed) ]
6494+ #[ allow( dead_code) ] // fields are never read
64786495 struct KL03Packed ( NotKnownLayout < AU32 > , u8 ) ;
64796496
64806497 let expected = DstLayout :: for_type :: < KL03Packed > ( ) ;
@@ -6485,6 +6502,7 @@ mod tests {
64856502 // ... with `packed(N)`
64866503 #[ derive( KnownLayout ) ]
64876504 #[ repr( packed( 2 ) ) ]
6505+ #[ allow( dead_code) ] // fields are never read
64886506 struct KL03PackedN ( NotKnownLayout < AU32 > , u8 ) ;
64896507
64906508 assert_impl_all ! ( KL03PackedN : KnownLayout ) ;
@@ -6497,6 +6515,7 @@ mod tests {
64976515 // | `repr(C)`? | generic? | `KnownLayout`? | `Sized`? | Type Name |
64986516 // | N | Y | N | Y | KL05 |
64996517 #[ derive( KnownLayout ) ]
6518+ #[ allow( dead_code) ] // fields are never read
65006519 struct KL05 < T > ( u8 , T ) ;
65016520
65026521 fn _test_kl05 < T > ( t : T ) -> impl KnownLayout {
@@ -6506,6 +6525,7 @@ mod tests {
65066525 // | `repr(C)`? | generic? | `KnownLayout`? | `Sized`? | Type Name |
65076526 // | N | Y | Y | Y | KL07 |
65086527 #[ derive( KnownLayout ) ]
6528+ #[ allow( dead_code) ] // fields are never read
65096529 struct KL07 < T : KnownLayout > ( u8 , T ) ;
65106530
65116531 fn _test_kl07 < T : KnownLayout > ( t : T ) -> impl KnownLayout {
@@ -7656,6 +7676,7 @@ mod tests {
76567676 fn test_transparent_packed_generic_struct ( ) {
76577677 #[ derive( AsBytes , FromZeroes , FromBytes , Unaligned ) ]
76587678 #[ repr( transparent) ]
7679+ #[ allow( dead_code) ] // for the unused fields
76597680 struct Foo < T > {
76607681 _t : T ,
76617682 _phantom : PhantomData < ( ) > ,
@@ -7666,6 +7687,7 @@ mod tests {
76667687
76677688 #[ derive( AsBytes , FromZeroes , FromBytes , Unaligned ) ]
76687689 #[ repr( packed) ]
7690+ #[ allow( dead_code) ] // for the unused fields
76697691 struct Bar < T , U > {
76707692 _t : T ,
76717693 _u : U ,
0 commit comments