Skip to content

Commit 6b8a748

Browse files
joshlfjswrenn
andauthored
[ci] Roll pinned nightly toolchain (#2753)
Co-authored-by: Jack Wrenn <jswrenn@amazon.com>
1 parent e8eb595 commit 6b8a748

File tree

9 files changed

+94
-28
lines changed

9 files changed

+94
-28
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ zerocopy-panic-in-const-and-vec-try-reserve-1-57-0 = "1.57.0"
6060
[package.metadata.ci]
6161
# The versions of the stable and nightly compiler toolchains to use in CI.
6262
pinned-stable = "1.90.0"
63-
pinned-nightly = "nightly-2025-10-17"
63+
pinned-nightly = "nightly-2025-11-04"
6464

6565
[package.metadata.docs.rs]
6666
all-features = true

src/util/mod.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,7 @@ where
362362
}
363363
} else {
364364
let align = T::LAYOUT.align.get();
365+
365366
// We use `transmute` instead of an `as` cast since Miri (with strict
366367
// provenance enabled) notices and complains that an `as` cast creates a
367368
// pointer with no provenance. Miri isn't smart enough to realize that
@@ -370,7 +371,9 @@ where
370371
//
371372
// SAFETY: any initialized bit sequence is a bit-valid `*mut u8`. All
372373
// bits of a `usize` are initialized.
373-
#[allow(unknown_lints)] // For `integer_to_ptr_transmutes`
374+
//
375+
// `#[allow(unknown_lints)]` is for `integer_to_ptr_transmutes`
376+
#[allow(unknown_lints)]
374377
#[allow(clippy::useless_transmute, integer_to_ptr_transmutes)]
375378
let dangling = unsafe { mem::transmute::<usize, *mut u8>(align) };
376379
// SAFETY: `dangling` is constructed from `T::LAYOUT.align`, which is a

src/wrappers.rs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,19 @@ pub struct Unalign<T>(T);
119119
// `KnownLayout` impl bounded on `T: KnownLayout.` This is overly restrictive.
120120
impl_known_layout!(T => Unalign<T>);
121121

122+
// FIXME(https://github.com/rust-lang/rust-clippy/issues/16087): Move these
123+
// attributes below the comment once this Clippy bug is fixed.
124+
#[cfg_attr(
125+
all(__ZEROCOPY_INTERNAL_USE_ONLY_NIGHTLY_FEATURES_IN_TESTS, any(feature = "derive", test)),
126+
expect(unused_unsafe)
127+
)]
128+
#[cfg_attr(
129+
all(
130+
not(__ZEROCOPY_INTERNAL_USE_ONLY_NIGHTLY_FEATURES_IN_TESTS),
131+
any(feature = "derive", test)
132+
),
133+
allow(unused_unsafe)
134+
)]
122135
// SAFETY:
123136
// - `Unalign<T>` promises to have alignment 1, and so we don't require that `T:
124137
// Unaligned`.
@@ -128,7 +141,7 @@ impl_known_layout!(T => Unalign<T>);
128141
// `UnsafeCell`s exactly when `T` does.
129142
// - `TryFromBytes`: `Unalign<T>` has the same the same bit validity as `T`, so
130143
// `T::is_bit_valid` is a sound implementation of `is_bit_valid`.
131-
#[allow(unused_unsafe)] // Unused when `feature = "derive"`.
144+
//
132145
const _: () = unsafe {
133146
impl_or_verify!(T => Unaligned for Unalign<T>);
134147
impl_or_verify!(T: Immutable => Immutable for Unalign<T>);

tests/ui-nightly/transmute-ptr-to-usize.stderr

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@ error[E0277]: the trait bound `*const usize: IntoBytes` is not satisfied
88
| required by a bound introduced by this call
99
|
1010
= note: Consider adding `#[derive(IntoBytes)]` to `*const usize`
11-
= help: the trait `IntoBytes` is implemented for `usize`
11+
help: the trait `IntoBytes` is implemented for `usize`
12+
--> src/impls.rs
13+
|
14+
| unsafe_impl!(usize: Immutable, TryFromBytes, FromZeros, FromBytes, IntoBytes);
15+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1216
note: required by a bound in `POINTER_VALUE::transmute`
1317
--> tests/ui-nightly/transmute-ptr-to-usize.rs:20:30
1418
|

zerocopy-derive/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ libc = "=0.2.163"
4545
# This is the latest version which is compatible with `syn` 2.0.46, which we pin
4646
# to in CI for MSRV compatibility reasons.
4747
prettyplease = "=0.2.17"
48+
proc-macro2 = "=1.0.80"
4849
quote = "=1.0.40"
4950
rustversion = "1.0"
5051
static_assertions = "1.1"

zerocopy-derive/tests/struct_to_bytes.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,15 +48,15 @@ util_assert_impl_all!(C: imp::IntoBytes);
4848
#[repr(transparent)]
4949
struct Transparent {
5050
a: u8,
51-
b: CZst,
51+
b: (),
5252
}
5353

5454
util_assert_impl_all!(Transparent: imp::IntoBytes);
5555

5656
#[derive(imp::IntoBytes)]
5757
#[repr(transparent)]
5858
struct TransparentGeneric<T: ?imp::Sized> {
59-
a: CZst,
59+
a: (),
6060
b: T,
6161
}
6262

zerocopy-derive/tests/ui-nightly/enum.stderr

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -467,8 +467,12 @@ error[E0277]: `IntoBytes1` has 1 total byte(s) of padding
467467
= note: consider using `zerocopy::Unalign` to lower the alignment of individual fields
468468
= note: consider adding explicit fields where padding would be
469469
= note: consider using `#[repr(packed)]` to remove padding
470-
= help: the trait `PaddingFree<IntoBytes1, 1>` is not implemented for `()`
471-
but trait `PaddingFree<IntoBytes1, 0>` is implemented for it
470+
help: the trait `PaddingFree<IntoBytes1, 1>` is not implemented for `()`
471+
but trait `PaddingFree<IntoBytes1, 0>` is implemented for it
472+
--> $WORKSPACE/src/util/macro_util.rs
473+
|
474+
63 | impl<T: ?Sized> PaddingFree<T, 0> for () {}
475+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
472476
= help: see issue #48214
473477
= note: this error originates in the derive macro `IntoBytes` (in Nightly builds, run with -Z macro-backtrace for more info)
474478
help: add `#![feature(trivial_bounds)]` to the crate attributes to enable
@@ -485,8 +489,12 @@ error[E0277]: `IntoBytes2` has 3 total byte(s) of padding
485489
= note: consider using `zerocopy::Unalign` to lower the alignment of individual fields
486490
= note: consider adding explicit fields where padding would be
487491
= note: consider using `#[repr(packed)]` to remove padding
488-
= help: the trait `PaddingFree<IntoBytes2, 3>` is not implemented for `()`
489-
but trait `PaddingFree<IntoBytes2, 0>` is implemented for it
492+
help: the trait `PaddingFree<IntoBytes2, 3>` is not implemented for `()`
493+
but trait `PaddingFree<IntoBytes2, 0>` is implemented for it
494+
--> $WORKSPACE/src/util/macro_util.rs
495+
|
496+
63 | impl<T: ?Sized> PaddingFree<T, 0> for () {}
497+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
490498
= help: see issue #48214
491499
= note: this error originates in the derive macro `IntoBytes` (in Nightly builds, run with -Z macro-backtrace for more info)
492500
help: add `#![feature(trivial_bounds)]` to the crate attributes to enable
@@ -503,8 +511,12 @@ error[E0277]: `IntoBytes3` has 2 total byte(s) of padding
503511
= note: consider using `zerocopy::Unalign` to lower the alignment of individual fields
504512
= note: consider adding explicit fields where padding would be
505513
= note: consider using `#[repr(packed)]` to remove padding
506-
= help: the trait `PaddingFree<IntoBytes3, 2>` is not implemented for `()`
507-
but trait `PaddingFree<IntoBytes3, 0>` is implemented for it
514+
help: the trait `PaddingFree<IntoBytes3, 2>` is not implemented for `()`
515+
but trait `PaddingFree<IntoBytes3, 0>` is implemented for it
516+
--> $WORKSPACE/src/util/macro_util.rs
517+
|
518+
63 | impl<T: ?Sized> PaddingFree<T, 0> for () {}
519+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
508520
= help: see issue #48214
509521
= note: this error originates in the derive macro `IntoBytes` (in Nightly builds, run with -Z macro-backtrace for more info)
510522
help: add `#![feature(trivial_bounds)]` to the crate attributes to enable

zerocopy-derive/tests/ui-nightly/struct.stderr

Lines changed: 43 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -320,8 +320,12 @@ error[E0277]: `IntoBytes2` has 1 total byte(s) of padding
320320
= note: consider using `zerocopy::Unalign` to lower the alignment of individual fields
321321
= note: consider adding explicit fields where padding would be
322322
= note: consider using `#[repr(packed)]` to remove padding
323-
= help: the trait `PaddingFree<IntoBytes2, 1>` is not implemented for `()`
324-
but trait `PaddingFree<IntoBytes2, 0>` is implemented for it
323+
help: the trait `PaddingFree<IntoBytes2, 1>` is not implemented for `()`
324+
but trait `PaddingFree<IntoBytes2, 0>` is implemented for it
325+
--> $WORKSPACE/src/util/macro_util.rs
326+
|
327+
63 | impl<T: ?Sized> PaddingFree<T, 0> for () {}
328+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
325329
= help: see issue #48214
326330
= note: this error originates in the derive macro `IntoBytes` (in Nightly builds, run with -Z macro-backtrace for more info)
327331
help: add `#![feature(trivial_bounds)]` to the crate attributes to enable
@@ -338,8 +342,12 @@ error[E0277]: `IntoBytes3` has 1 total byte(s) of padding
338342
= note: consider using `zerocopy::Unalign` to lower the alignment of individual fields
339343
= note: consider adding explicit fields where padding would be
340344
= note: consider using `#[repr(packed)]` to remove padding
341-
= help: the trait `PaddingFree<IntoBytes3, 1>` is not implemented for `()`
342-
but trait `PaddingFree<IntoBytes3, 0>` is implemented for it
345+
help: the trait `PaddingFree<IntoBytes3, 1>` is not implemented for `()`
346+
but trait `PaddingFree<IntoBytes3, 0>` is implemented for it
347+
--> $WORKSPACE/src/util/macro_util.rs
348+
|
349+
63 | impl<T: ?Sized> PaddingFree<T, 0> for () {}
350+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
343351
= help: see issue #48214
344352
= note: this error originates in the derive macro `IntoBytes` (in Nightly builds, run with -Z macro-backtrace for more info)
345353
help: add `#![feature(trivial_bounds)]` to the crate attributes to enable
@@ -392,8 +400,12 @@ error[E0277]: `IntoBytes5` has one or more padding bytes
392400
= note: consider using `zerocopy::Unalign` to lower the alignment of individual fields
393401
= note: consider adding explicit fields where padding would be
394402
= note: consider using `#[repr(packed)]` to remove padding
395-
= help: the trait `DynamicPaddingFree<IntoBytes5, true>` is not implemented for `()`
396-
but trait `DynamicPaddingFree<IntoBytes5, false>` is implemented for it
403+
help: the trait `DynamicPaddingFree<IntoBytes5, true>` is not implemented for `()`
404+
but trait `DynamicPaddingFree<IntoBytes5, false>` is implemented for it
405+
--> $WORKSPACE/src/util/macro_util.rs
406+
|
407+
81 | impl<T: ?Sized> DynamicPaddingFree<T, false> for () {}
408+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
397409
= help: see issue #48214
398410
= note: this error originates in the derive macro `IntoBytes` (in Nightly builds, run with -Z macro-backtrace for more info)
399411
help: add `#![feature(trivial_bounds)]` to the crate attributes to enable
@@ -410,8 +422,12 @@ error[E0277]: `IntoBytes6` has one or more padding bytes
410422
= note: consider using `zerocopy::Unalign` to lower the alignment of individual fields
411423
= note: consider adding explicit fields where padding would be
412424
= note: consider using `#[repr(packed)]` to remove padding
413-
= help: the trait `DynamicPaddingFree<IntoBytes6, true>` is not implemented for `()`
414-
but trait `DynamicPaddingFree<IntoBytes6, false>` is implemented for it
425+
help: the trait `DynamicPaddingFree<IntoBytes6, true>` is not implemented for `()`
426+
but trait `DynamicPaddingFree<IntoBytes6, false>` is implemented for it
427+
--> $WORKSPACE/src/util/macro_util.rs
428+
|
429+
81 | impl<T: ?Sized> DynamicPaddingFree<T, false> for () {}
430+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
415431
= help: see issue #48214
416432
= note: this error originates in the derive macro `IntoBytes` (in Nightly builds, run with -Z macro-backtrace for more info)
417433
help: add `#![feature(trivial_bounds)]` to the crate attributes to enable
@@ -428,8 +444,12 @@ error[E0277]: `IntoBytes7` has one or more padding bytes
428444
= note: consider using `zerocopy::Unalign` to lower the alignment of individual fields
429445
= note: consider adding explicit fields where padding would be
430446
= note: consider using `#[repr(packed)]` to remove padding
431-
= help: the trait `DynamicPaddingFree<IntoBytes7, true>` is not implemented for `()`
432-
but trait `DynamicPaddingFree<IntoBytes7, false>` is implemented for it
447+
help: the trait `DynamicPaddingFree<IntoBytes7, true>` is not implemented for `()`
448+
but trait `DynamicPaddingFree<IntoBytes7, false>` is implemented for it
449+
--> $WORKSPACE/src/util/macro_util.rs
450+
|
451+
81 | impl<T: ?Sized> DynamicPaddingFree<T, false> for () {}
452+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
433453
= help: see issue #48214
434454
= note: this error originates in the derive macro `IntoBytes` (in Nightly builds, run with -Z macro-backtrace for more info)
435455
help: add `#![feature(trivial_bounds)]` to the crate attributes to enable
@@ -479,10 +499,19 @@ error[E0277]: the trait bound `u8: SplitAt` is not satisfied
479499
| ^^^^^^^ the trait `SplitAt` is not implemented for `u8`
480500
|
481501
= note: Consider adding `#[derive(SplitAt)]` to `u8`
482-
= help: the following other types implement trait `SplitAt`:
483-
SplitAtNotKnownLayout
484-
SplitAtSized
485-
[T]
502+
help: the following other types implement trait `SplitAt`
503+
--> tests/ui-nightly/struct.rs:248:10
504+
|
505+
248 | #[derive(SplitAt)]
506+
| ^^^^^^^ `SplitAtNotKnownLayout`
507+
...
508+
252 | #[derive(SplitAt, KnownLayout)]
509+
| ^^^^^^^ `SplitAtSized`
510+
|
511+
::: $WORKSPACE/src/split_at.rs
512+
|
513+
| unsafe impl<T> SplitAt for [T] {
514+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `[T]`
486515
= help: see issue #48214
487516
= note: this error originates in the derive macro `SplitAt` (in Nightly builds, run with -Z macro-backtrace for more info)
488517
help: add `#![feature(trivial_bounds)]` to the crate attributes to enable

zerocopy-derive/tests/ui-nightly/union.stderr

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,12 @@ error[E0277]: `IntoBytes2` has 1 total byte(s) of padding
110110
= note: consider using `zerocopy::Unalign` to lower the alignment of individual fields
111111
= note: consider adding explicit fields where padding would be
112112
= note: consider using `#[repr(packed)]` to remove padding
113-
= help: the trait `PaddingFree<IntoBytes2, 1>` is not implemented for `()`
114-
but trait `PaddingFree<IntoBytes2, 0>` is implemented for it
113+
help: the trait `PaddingFree<IntoBytes2, 1>` is not implemented for `()`
114+
but trait `PaddingFree<IntoBytes2, 0>` is implemented for it
115+
--> $WORKSPACE/src/util/macro_util.rs
116+
|
117+
| impl<T: ?Sized> PaddingFree<T, 0> for () {}
118+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
115119
= help: see issue #48214
116120
= note: this error originates in the derive macro `IntoBytes` (in Nightly builds, run with -Z macro-backtrace for more info)
117121
help: add `#![feature(trivial_bounds)]` to the crate attributes to enable

0 commit comments

Comments
 (0)