Skip to content

Commit 9a18ddf

Browse files
committed
Roll toolchains, release 0.7.33
1 parent 94b7e0a commit 9a18ddf

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+459
-626
lines changed

Cargo.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
[package]
1616
edition = "2018"
1717
name = "zerocopy"
18-
version = "0.7.32"
18+
version = "0.7.33"
1919
authors = ["Joshua Liebow-Feeser <[email protected]>"]
2020
description = "Utilities for zero-copy parsing and serialization"
2121
license = "BSD-2-Clause OR Apache-2.0 OR MIT"
@@ -30,8 +30,8 @@ rustdoc-args = ["--cfg", "doc_cfg", "--generate-link-to-definition"]
3030

3131
[package.metadata.ci]
3232
# The versions of the stable and nightly compiler toolchains to use in CI.
33-
pinned-stable = "1.74.0"
34-
pinned-nightly = "nightly-2023-12-05"
33+
pinned-stable = "1.78.0"
34+
pinned-nightly = "nightly-2024-05-02"
3535

3636
[package.metadata.playground]
3737
features = ["__internal_use_only_features_that_work_on_stable"]
@@ -49,7 +49,7 @@ simd-nightly = ["simd"]
4949
__internal_use_only_features_that_work_on_stable = ["alloc", "derive", "simd"]
5050

5151
[dependencies]
52-
zerocopy-derive = { version = "=0.7.32", path = "zerocopy-derive", optional = true }
52+
zerocopy-derive = { version = "=0.7.33", path = "zerocopy-derive", optional = true }
5353

5454
[dependencies.byteorder]
5555
version = "1.3"
@@ -60,7 +60,7 @@ optional = true
6060
# zerocopy-derive remain equal, even if the 'derive' feature isn't used.
6161
# See: https://github.com/matklad/macro-dep-test
6262
[target.'cfg(any())'.dependencies]
63-
zerocopy-derive = { version = "=0.7.32", path = "zerocopy-derive" }
63+
zerocopy-derive = { version = "=0.7.33", path = "zerocopy-derive" }
6464

6565
[dev-dependencies]
6666
assert_matches = "1.5"
@@ -75,6 +75,6 @@ testutil = { path = "testutil" }
7575
# CI test failures.
7676
trybuild = { version = "=1.0.85", features = ["diff"] }
7777
# In tests, unlike in production, zerocopy-derive is not optional
78-
zerocopy-derive = { version = "=0.7.32", path = "zerocopy-derive" }
78+
zerocopy-derive = { version = "=0.7.33", path = "zerocopy-derive" }
7979
# TODO(#381) Remove this dependency once we have our own layout gadgets.
8080
elain = "0.3.0"

src/lib.rs

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,6 @@
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,
@@ -228,7 +227,18 @@
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,

src/macro_util.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -478,6 +478,7 @@ mod tests {
478478
macro_rules! test {
479479
(#[$cfg:meta] ($($ts:ty),* ; $trailing_field_ty:ty) => $expect:expr) => {{
480480
#[$cfg]
481+
#[allow(dead_code)] // fields are never read
481482
struct Test($($ts,)* $trailing_field_ty);
482483
assert_eq!(test!(@offset $($ts),* ; $trailing_field_ty), $expect);
483484
}};
@@ -617,6 +618,7 @@ mod tests {
617618
macro_rules! test {
618619
(#[$cfg:meta] ($($ts:ty),*) => $expect:expr) => {{
619620
#[$cfg]
621+
#[allow(dead_code)] // fields are never read
620622
struct Test($($ts),*);
621623
assert_eq!(struct_has_padding!(Test, $($ts),*), $expect);
622624
}};

src/macros.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,7 @@ macro_rules! unsafe_impl_known_layout {
375375
const _: () = {
376376
use core::ptr::NonNull;
377377

378+
#[allow(non_local_definitions)]
378379
unsafe impl<$($tyvar: ?Sized + KnownLayout)?> KnownLayout for $ty {
379380
#[allow(clippy::missing_inline_in_public_items)]
380381
fn only_derive_is_allowed_to_implement_this_trait() {}

src/util.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -652,10 +652,12 @@ pub(crate) mod polyfills {
652652
// MSRV is 1.70, when that function was stabilized.
653653
//
654654
// TODO(#67): Once our MSRV is 1.70, remove this.
655+
#[allow(unused)]
655656
pub(crate) trait NonNullExt<T> {
656657
fn slice_from_raw_parts(data: Self, len: usize) -> NonNull<[T]>;
657658
}
658659

660+
#[allow(unused)]
659661
impl<T> NonNullExt<T> for NonNull<T> {
660662
#[inline(always)]
661663
fn slice_from_raw_parts(data: Self, len: usize) -> NonNull<[T]> {

src/wrappers.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ impl<T> Unalign<T> {
134134
/// may prefer [`Deref::deref`], which is infallible.
135135
#[inline(always)]
136136
pub fn try_deref(&self) -> Option<&T> {
137-
if !crate::util::aligned_to::<_, T>(self) {
137+
if !util::aligned_to::<_, T>(self) {
138138
return None;
139139
}
140140

@@ -154,7 +154,7 @@ impl<T> Unalign<T> {
154154
/// callers may prefer [`DerefMut::deref_mut`], which is infallible.
155155
#[inline(always)]
156156
pub fn try_deref_mut(&mut self) -> Option<&mut T> {
157-
if !crate::util::aligned_to::<_, T>(&*self) {
157+
if !util::aligned_to::<_, T>(&*self) {
158158
return None;
159159
}
160160

tests/ui-nightly/include_value_not_from_bytes.stderr

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ error[E0277]: the trait bound `UnsafeCell<u32>: FromBytes` is not satisfied
88
| required by a bound introduced by this call
99
|
1010
= help: the following other types implement trait `FromBytes`:
11-
isize
12-
i8
13-
i16
14-
i32
15-
i64
16-
i128
17-
usize
18-
u8
11+
()
12+
F32<O>
13+
F64<O>
14+
I128<O>
15+
I16<O>
16+
I32<O>
17+
I64<O>
18+
ManuallyDrop<T>
1919
and $N others
2020
note: required by a bound in `AssertIsFromBytes`
2121
--> tests/ui-nightly/include_value_not_from_bytes.rs:12:5

tests/ui-nightly/invalid-impls/invalid-impls.stderr

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error[E0277]: the trait bound `T: zerocopy::FromZeroes` is not satisfied
22
--> tests/ui-nightly/invalid-impls/invalid-impls.rs:26:37
33
|
44
26 | impl_or_verify!(T => FromZeroes for Foo<T>);
5-
| ^^^^^^ the trait `zerocopy::FromZeroes` is not implemented for `T`
5+
| ^^^^^^ the trait `zerocopy::FromZeroes` is not implemented for `T`, which is required by `Foo<T>: zerocopy::FromZeroes`
66
|
77
note: required for `Foo<T>` to implement `zerocopy::FromZeroes`
88
--> tests/ui-nightly/invalid-impls/invalid-impls.rs:22:10
@@ -29,7 +29,7 @@ error[E0277]: the trait bound `T: zerocopy::FromBytes` is not satisfied
2929
--> tests/ui-nightly/invalid-impls/invalid-impls.rs:27:36
3030
|
3131
27 | impl_or_verify!(T => FromBytes for Foo<T>);
32-
| ^^^^^^ the trait `zerocopy::FromBytes` is not implemented for `T`
32+
| ^^^^^^ the trait `zerocopy::FromBytes` is not implemented for `T`, which is required by `Foo<T>: zerocopy::FromBytes`
3333
|
3434
note: required for `Foo<T>` to implement `zerocopy::FromBytes`
3535
--> tests/ui-nightly/invalid-impls/invalid-impls.rs:22:22
@@ -56,7 +56,7 @@ error[E0277]: the trait bound `T: zerocopy::AsBytes` is not satisfied
5656
--> tests/ui-nightly/invalid-impls/invalid-impls.rs:28:34
5757
|
5858
28 | impl_or_verify!(T => AsBytes for Foo<T>);
59-
| ^^^^^^ the trait `zerocopy::AsBytes` is not implemented for `T`
59+
| ^^^^^^ the trait `zerocopy::AsBytes` is not implemented for `T`, which is required by `Foo<T>: zerocopy::AsBytes`
6060
|
6161
note: required for `Foo<T>` to implement `zerocopy::AsBytes`
6262
--> tests/ui-nightly/invalid-impls/invalid-impls.rs:22:33
@@ -83,7 +83,7 @@ error[E0277]: the trait bound `T: zerocopy::Unaligned` is not satisfied
8383
--> tests/ui-nightly/invalid-impls/invalid-impls.rs:29:36
8484
|
8585
29 | impl_or_verify!(T => Unaligned for Foo<T>);
86-
| ^^^^^^ the trait `zerocopy::Unaligned` is not implemented for `T`
86+
| ^^^^^^ the trait `zerocopy::Unaligned` is not implemented for `T`, which is required by `Foo<T>: zerocopy::Unaligned`
8787
|
8888
note: required for `Foo<T>` to implement `zerocopy::Unaligned`
8989
--> tests/ui-nightly/invalid-impls/invalid-impls.rs:22:42

tests/ui-nightly/max-align.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0589]: invalid `repr(align)` attribute: larger than 2^29
2-
--> tests/ui-nightly/max-align.rs:96:11
2+
--> tests/ui-nightly/max-align.rs:96:17
33
|
44
96 | #[repr(C, align(1073741824))]
5-
| ^^^^^^^^^^^^^^^^^
5+
| ^^^^^^^^^^

tests/ui-nightly/transmute-dst-not-frombytes.stderr

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ error[E0277]: the trait bound `NotZerocopy: FromBytes` is not satisfied
88
| required by a bound introduced by this call
99
|
1010
= help: the following other types implement trait `FromBytes`:
11-
isize
12-
i8
13-
i16
14-
i32
15-
i64
16-
i128
17-
usize
18-
u8
11+
()
12+
AU16
13+
F32<O>
14+
F64<O>
15+
I128<O>
16+
I16<O>
17+
I32<O>
18+
I64<O>
1919
and $N others
2020
note: required by a bound in `AssertIsFromBytes`
2121
--> tests/ui-nightly/transmute-dst-not-frombytes.rs:18:41

0 commit comments

Comments
 (0)