Skip to content

Commit d769fb9

Browse files
[ci] Roll pinned nightly toolchain (#2442)
We remove `simd-nightly` impls for the `arm` target `[u]int8x4_t` types, which are now just type aliases for `u32` and `i32`. We also switch from using `wasm32-wasi` to `wasm32-unknown-unknown` in CI, as the former is less supported (and not available via `rustup` on this particular nightly). gherrit-pr-id: I0a19a7789334f41ffedc55b871df9736d4b51484
1 parent 8e2fe2c commit d769fb9

24 files changed

+90
-95
lines changed

.github/workflows/ci.yml

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ jobs:
6868
"s390x-unknown-linux-gnu",
6969
"x86_64-pc-windows-msvc",
7070
"thumbv6m-none-eabi",
71-
"wasm32-wasi"
71+
"wasm32-unknown-unknown"
7272
]
7373
features: [
7474
"--no-default-features",
@@ -124,7 +124,7 @@ jobs:
124124
# Exclude stable/wasm since wasm is no longer provided via rustup on
125125
# stable.
126126
- toolchain: "stable"
127-
target: "wasm32-wasi"
127+
target: "wasm32-unknown-unknown"
128128
# Exclude non-aarch64 targets from the `zerocopy-aarch64-simd-1-59-0`
129129
# toolchain.
130130
- toolchain: "zerocopy-aarch64-simd-1-59-0"
@@ -146,7 +146,7 @@ jobs:
146146
- toolchain: "zerocopy-aarch64-simd-1-59-0"
147147
target: "thumbv6m-none-eabi"
148148
- toolchain: "zerocopy-aarch64-simd-1-59-0"
149-
target: "wasm32-wasi"
149+
target: "wasm32-unknown-unknown"
150150
# Exclude most targets targets from the `zerocopy-core-error-1-81-0`
151151
# toolchain since the `zerocopy-core-error-1-81-0` feature is unrelated to
152152
# compilation target. This only leaves i686 and x86_64 targets.
@@ -167,7 +167,7 @@ jobs:
167167
- toolchain: "zerocopy-core-error-1-81-0"
168168
target: "thumbv6m-none-eabi"
169169
- toolchain: "zerocopy-core-error-1-81-0"
170-
target: "wasm32-wasi"
170+
target: "wasm32-unknown-unknown"
171171
# Exclude most targets targets from the
172172
# `zerocopy-diagnostic-on-unimplemented-1-78-0` toolchain since the
173173
# `zerocopy-diagnostic-on-unimplemented-1-78-0` feature is unrelated to
@@ -189,7 +189,7 @@ jobs:
189189
- toolchain: "zerocopy-diagnostic-on-unimplemented-1-78-0"
190190
target: "thumbv6m-none-eabi"
191191
- toolchain: "zerocopy-diagnostic-on-unimplemented-1-78-0"
192-
target: "wasm32-wasi"
192+
target: "wasm32-unknown-unknown"
193193
# Exclude most targets targets from the
194194
# `zerocopy-generic-bounds-in-const-fn-1-61-0` toolchain since the
195195
# `zerocopy-generic-bounds-in-const-fn-1-61-0` feature is unrelated to
@@ -211,7 +211,7 @@ jobs:
211211
- toolchain: "zerocopy-generic-bounds-in-const-fn-1-61-0"
212212
target: "thumbv6m-none-eabi"
213213
- toolchain: "zerocopy-generic-bounds-in-const-fn-1-61-0"
214-
target: "wasm32-wasi"
214+
target: "wasm32-unknown-unknown"
215215
# Exclude `thumbv6m-none-eabi` combined with any feature that implies
216216
# the `std` feature since `thumbv6m-none-eabi` does not include a
217217
# pre-compiled std.
@@ -237,7 +237,7 @@ jobs:
237237
event_name: "pull_request"
238238
- target: "thumbv6m-none-eabi"
239239
event_name: "pull_request"
240-
- target: "wasm32-wasi"
240+
- target: "wasm32-unknown-unknown"
241241
event_name: "pull_request"
242242

243243
name: Build & Test (${{ matrix.crate }} / ${{ matrix.toolchain }} / ${{ matrix.features }} / ${{ matrix.target }})
@@ -447,12 +447,12 @@ jobs:
447447
# Miri can catch any errors before a PR is merged into main.
448448
#
449449
# TODO(#22): Re-enable testing on riscv64gc-unknown-linux-gnu and/or
450-
# wasm32-wasi once those work.
450+
# wasm32-unknown-unknown once those work.
451451
if: |
452452
matrix.toolchain == 'nightly' &&
453453
matrix.target != 'riscv64gc-unknown-linux-gnu' &&
454454
matrix.target != 'thumbv6m-none-eabi' &&
455-
matrix.target != 'wasm32-wasi' &&
455+
matrix.target != 'wasm32-unknown-unknown' &&
456456
github.event_name != 'pull_request'
457457
458458
# On the `thumbv6m-none-eabi` target, we can't run `cargo clippy --tests`
@@ -526,13 +526,12 @@ jobs:
526526
features: __internal_use_only_features_that_work_on_stable
527527
rust-toolchain: ${{ env.ZC_TOOLCHAIN }}
528528
rust-target: ${{ matrix.target }}
529-
# TODO(#1565): Run on wasm32-wasi. As of this writing, this target fails:
530-
# https://github.com/google/zerocopy/actions/runs/9944220377/job/27469879712
529+
# TODO(#1565): Run on wasm32-unknown-unknown.
531530
if: |
532531
matrix.crate == 'zerocopy' &&
533532
matrix.features == '--features __internal_use_only_features_that_work_on_stable' &&
534533
matrix.toolchain == 'stable' &&
535-
matrix.target != 'wasm32-wasi' &&
534+
matrix.target != 'wasm32-unknown-unknown' &&
536535
env.ZC_SKIP_CARGO_SEMVER_CHECKS != '1'
537536
538537
# TODO(#453): Doing this as a matrix step is a hack that allows us to depend

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.85.0"
63-
pinned-nightly = "nightly-2024-11-06"
63+
pinned-nightly = "nightly-2025-03-17"
6464

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

src/impls.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1127,10 +1127,6 @@ mod simd {
11271127
uint8x16x2_t, uint8x16x3_t, uint8x16x4_t, uint16x4_t, uint16x8_t, uint32x2_t, uint32x4_t,
11281128
uint64x1_t, uint64x2_t
11291129
);
1130-
simd_arch_mod!(
1131-
#[cfg(all(feature = "simd-nightly", target_arch = "arm"))]
1132-
arm, arm, int8x4_t, uint8x4_t
1133-
);
11341130
};
11351131
}
11361132

@@ -2130,9 +2126,6 @@ mod tests {
21302126
uint8x16x2_t, uint8x16x3_t, uint8x16x4_t, uint16x4_t, uint16x8_t, uint32x2_t, uint32x4_t,
21312127
uint64x1_t, uint64x2_t
21322128
);
2133-
#[cfg(all(feature = "simd-nightly", target_arch = "arm"))]
2134-
#[rustfmt::skip]
2135-
test_simd_arch_mod!(arm, int8x4_t, uint8x4_t);
21362129
}
21372130
}
21382131
}

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -871,7 +871,7 @@ impl PointerMetadata for usize {
871871

872872
// SAFETY: Delegates safety to `DstLayout::for_slice`.
873873
unsafe impl<T> KnownLayout for [T] {
874-
#[allow(clippy::missing_inline_in_public_items)]
874+
#[allow(clippy::missing_inline_in_public_items, dead_code)]
875875
#[cfg_attr(
876876
all(coverage_nightly, __ZEROCOPY_INTERNAL_USE_ONLY_NIGHTLY_FEATURES_IN_TESTS),
877877
coverage(off)

src/pointer/inner.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ mod _def {
3939
/// byte range which is entirely contained in `A`.
4040
/// 3. `ptr` addresses a byte range whose length fits in an `isize`.
4141
/// 4. `ptr` addresses a byte range which does not wrap around the
42-
/// address space.
42+
/// address space.
4343
/// 5. If `ptr`'s referent is not zero sized,`A` is guaranteed to live
4444
/// for at least `'a`.
4545
ptr: NonNull<T>,

src/util/macros.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ macro_rules! unsafe_impl {
150150
};
151151

152152
(@method TryFromBytes ; |$candidate:ident| $is_bit_valid:expr) => {
153-
#[allow(clippy::missing_inline_in_public_items)]
153+
#[allow(clippy::missing_inline_in_public_items, dead_code)]
154154
#[cfg_attr(all(coverage_nightly, __ZEROCOPY_INTERNAL_USE_ONLY_NIGHTLY_FEATURES_IN_TESTS), coverage(off))]
155155
fn only_derive_is_allowed_to_implement_this_trait() {}
156156

@@ -166,7 +166,7 @@ macro_rules! unsafe_impl {
166166
#[inline(always)] fn is_bit_valid<AA: crate::pointer::invariant::Reference>(_: Maybe<'_, Self, AA>) -> bool { true }
167167
};
168168
(@method $trait:ident) => {
169-
#[allow(clippy::missing_inline_in_public_items)]
169+
#[allow(clippy::missing_inline_in_public_items, dead_code)]
170170
#[cfg_attr(all(coverage_nightly, __ZEROCOPY_INTERNAL_USE_ONLY_NIGHTLY_FEATURES_IN_TESTS), coverage(off))]
171171
fn only_derive_is_allowed_to_implement_this_trait() {}
172172
};
@@ -491,7 +491,7 @@ macro_rules! unsafe_impl_known_layout {
491491

492492
#[allow(non_local_definitions)]
493493
unsafe impl<$($tyvar: ?Sized + KnownLayout)?> KnownLayout for $ty {
494-
#[allow(clippy::missing_inline_in_public_items)]
494+
#[allow(clippy::missing_inline_in_public_items, dead_code)]
495495
#[cfg_attr(all(coverage_nightly, __ZEROCOPY_INTERNAL_USE_ONLY_NIGHTLY_FEATURES_IN_TESTS), coverage(off))]
496496
fn only_derive_is_allowed_to_implement_this_trait() {}
497497

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ note: required by a bound in `_::Subtrait`
2121
26 | impl_or_verify!(T => TryFromBytes for Foo<T>);
2222
| --------------------------------------------- in this macro invocation
2323
= note: this error originates in the derive macro `FromBytes` which comes from the expansion of the macro `impl_or_verify` (in Nightly builds, run with -Z macro-backtrace for more info)
24-
help: consider restricting type parameter `T`
24+
help: consider restricting type parameter `T` with trait `TryFromBytes`
2525
|
2626
26 | impl_or_verify!(T: zerocopy::TryFromBytes => TryFromBytes for Foo<T>);
2727
| ++++++++++++++++++++++++
@@ -49,7 +49,7 @@ note: required by a bound in `_::Subtrait`
4949
27 | impl_or_verify!(T => FromZeros for Foo<T>);
5050
| ------------------------------------------ in this macro invocation
5151
= note: this error originates in the derive macro `FromBytes` which comes from the expansion of the macro `impl_or_verify` (in Nightly builds, run with -Z macro-backtrace for more info)
52-
help: consider restricting type parameter `T`
52+
help: consider restricting type parameter `T` with trait `FromZeros`
5353
|
5454
27 | impl_or_verify!(T: zerocopy::FromZeros => FromZeros for Foo<T>);
5555
| +++++++++++++++++++++
@@ -77,7 +77,7 @@ note: required by a bound in `_::Subtrait`
7777
28 | impl_or_verify!(T => FromBytes for Foo<T>);
7878
| ------------------------------------------ in this macro invocation
7979
= note: this error originates in the derive macro `FromBytes` which comes from the expansion of the macro `impl_or_verify` (in Nightly builds, run with -Z macro-backtrace for more info)
80-
help: consider restricting type parameter `T`
80+
help: consider restricting type parameter `T` with trait `FromBytes`
8181
|
8282
28 | impl_or_verify!(T: zerocopy::FromBytes => FromBytes for Foo<T>);
8383
| +++++++++++++++++++++
@@ -105,7 +105,7 @@ note: required by a bound in `_::Subtrait`
105105
29 | impl_or_verify!(T => IntoBytes for Foo<T>);
106106
| ------------------------------------------ in this macro invocation
107107
= note: this error originates in the derive macro `IntoBytes` which comes from the expansion of the macro `impl_or_verify` (in Nightly builds, run with -Z macro-backtrace for more info)
108-
help: consider restricting type parameter `T`
108+
help: consider restricting type parameter `T` with trait `IntoBytes`
109109
|
110110
29 | impl_or_verify!(T: zerocopy::IntoBytes => IntoBytes for Foo<T>);
111111
| +++++++++++++++++++++
@@ -133,7 +133,7 @@ note: required by a bound in `_::Subtrait`
133133
30 | impl_or_verify!(T => Unaligned for Foo<T>);
134134
| ------------------------------------------ in this macro invocation
135135
= note: this error originates in the derive macro `Unaligned` which comes from the expansion of the macro `impl_or_verify` (in Nightly builds, run with -Z macro-backtrace for more info)
136-
help: consider restricting type parameter `T`
136+
help: consider restricting type parameter `T` with trait `Unaligned`
137137
|
138138
30 | impl_or_verify!(T: zerocopy::Unaligned => Unaligned for Foo<T>);
139139
| +++++++++++++++++++++

tests/ui-nightly/transmute-mut-const.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ note: `const` item defined here
1313
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
1414
= note: `#[warn(const_item_mutation)]` on by default
1515

16-
error[E0015]: cannot call non-const fn `transmute_mut::<'_, '_, [u8; 2], [u8; 2]>` in constants
16+
error[E0015]: cannot call non-const function `transmute_mut::<'_, '_, [u8; 2], [u8; 2]>` in constants
1717
--> tests/ui-nightly/transmute-mut-const.rs:20:37
1818
|
1919
20 | const CONST_CONTEXT: &mut [u8; 2] = transmute_mut!(&mut ARRAY_OF_U8S);

tests/ui-nightly/transmute-mut-dst-not-a-reference.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ help: the return type of this call is `&mut _` due to the type of the argument p
5353
--> tests/ui-nightly/transmute-mut-dst-not-a-reference.rs:17:36
5454
|
5555
17 | const DST_NOT_A_REFERENCE: usize = transmute_mut!(&mut 0u8);
56-
| ^^^^^^^^^^^^^^^^^^^^^^^^ this argument influences the return type of `$crate`
56+
| ^^^^^^^^^^^^^^^^^^^^^^^^ this argument influences the return type of `must_use`
5757
note: function defined here
5858
--> src/util/macro_util.rs
5959
|

tests/ui-nightly/transmute-mut-dst-unsized.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ error[E0277]: the size for values of type `[u8]` cannot be known at compilation
4848
|
4949
= help: the trait `Sized` is not implemented for `[u8]`
5050
note: required by an implicit `Sized` bound in `std::intrinsics::transmute`
51-
--> $RUST/core/src/intrinsics.rs
51+
--> $RUST/core/src/intrinsics/mod.rs
5252
|
53-
| pub const unsafe fn transmute<Src, Dst>(_src: Src) -> Dst {
53+
| pub const unsafe fn transmute<Src, Dst>(src: Src) -> Dst;
5454
| ^^^ required by the implicit `Sized` requirement on this type parameter in `transmute`
5555
= note: this error originates in the macro `$crate::assert_size_eq` which comes from the expansion of the macro `transmute_mut` (in Nightly builds, run with -Z macro-backtrace for more info)
5656

0 commit comments

Comments
 (0)