Skip to content

Commit 738e3f2

Browse files
Invert build.rs version detection flags and update CI (#2804)
Inverts version detection flags to default to enabled on modern compilers. Renames `zerocopy-foo` to `no-zerocopy-foo` in `Cargo.toml`, `build.rs`, source code, and `.github/workflows/ci.yml`. Ensures `check_all_toolchains_tested.sh` passes by syncing CI config. Verified unit tests on all affected toolchains. Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
1 parent 16d065d commit 738e3f2

File tree

12 files changed

+128
-128
lines changed

12 files changed

+128
-128
lines changed

.github/workflows/ci.yml

Lines changed: 65 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,13 @@ jobs:
5050
# These are the names of specific Rust versions detected in
5151
# `build.rs`. Each of these represents the minimum Rust version for
5252
# which a particular feature is supported.
53-
"zerocopy-simd-x86-avx12-1-89-0",
54-
"zerocopy-core-error-1-81-0",
55-
"zerocopy-diagnostic-on-unimplemented-1-78-0",
56-
"zerocopy-generic-bounds-in-const-fn-1-61-0",
57-
"zerocopy-target-has-atomics-1-60-0",
58-
"zerocopy-aarch64-simd-1-59-0",
59-
"zerocopy-panic-in-const-and-vec-try-reserve-1-57-0"
53+
"no-zerocopy-simd-x86-avx12-1-89-0",
54+
"no-zerocopy-core-error-1-81-0",
55+
"no-zerocopy-diagnostic-on-unimplemented-1-78-0",
56+
"no-zerocopy-generic-bounds-in-const-fn-1-61-0",
57+
"no-zerocopy-target-has-atomics-1-60-0",
58+
"no-zerocopy-aarch64-simd-1-59-0",
59+
"no-zerocopy-panic-in-const-and-vec-try-reserve-1-57-0"
6060
]
6161
target: [
6262
"i686-unknown-linux-gnu",
@@ -86,19 +86,19 @@ jobs:
8686
features: "--all-features"
8787
- toolchain: "stable"
8888
features: "--all-features"
89-
- toolchain: "zerocopy-simd-x86-avx12-1-89-0"
89+
- toolchain: "no-zerocopy-simd-x86-avx12-1-89-0"
9090
features: "--all-features"
91-
- toolchain: "zerocopy-core-error-1-81-0"
91+
- toolchain: "no-zerocopy-core-error-1-81-0"
9292
features: "--all-features"
93-
- toolchain: "zerocopy-diagnostic-on-unimplemented-1-78-0"
93+
- toolchain: "no-zerocopy-diagnostic-on-unimplemented-1-78-0"
9494
features: "--all-features"
95-
- toolchain: "zerocopy-generic-bounds-in-const-fn-1-61-0"
95+
- toolchain: "no-zerocopy-generic-bounds-in-const-fn-1-61-0"
9696
features: "--all-features"
97-
- toolchain: "zerocopy-target-has-atomics-1-60-0"
97+
- toolchain: "no-zerocopy-target-has-atomics-1-60-0"
9898
features: "--all-features"
99-
- toolchain: "zerocopy-aarch64-simd-1-59-0"
99+
- toolchain: "no-zerocopy-aarch64-simd-1-59-0"
100100
features: "--all-features"
101-
- toolchain: "zerocopy-panic-in-const-and-vec-try-reserve-1-57-0"
101+
- toolchain: "no-zerocopy-panic-in-const-and-vec-try-reserve-1-57-0"
102102
features: "--all-features"
103103
# Exclude any combination for the zerocopy-derive crate which
104104
# uses zerocopy features.
@@ -113,109 +113,109 @@ jobs:
113113
# exist to exercise zerocopy behavior which differs by toolchain;
114114
# zerocopy-derive doesn't behave differently on these toolchains.
115115
- crate: "zerocopy-derive"
116-
toolchain: "zerocopy-simd-x86-avx12-1-89-0"
116+
toolchain: "no-zerocopy-simd-x86-avx12-1-89-0"
117117
- crate: "zerocopy-derive"
118-
toolchain: "zerocopy-core-error-1-81-0"
118+
toolchain: "no-zerocopy-core-error-1-81-0"
119119
- crate: "zerocopy-derive"
120-
toolchain: "zerocopy-diagnostic-on-unimplemented-1-78-0"
120+
toolchain: "no-zerocopy-diagnostic-on-unimplemented-1-78-0"
121121
- crate: "zerocopy-derive"
122-
toolchain: "zerocopy-generic-bounds-in-const-fn-1-61-0"
122+
toolchain: "no-zerocopy-generic-bounds-in-const-fn-1-61-0"
123123
- crate: "zerocopy-derive"
124-
toolchain: "zerocopy-target-has-atomics-1-60-0"
124+
toolchain: "no-zerocopy-target-has-atomics-1-60-0"
125125
- crate: "zerocopy-derive"
126-
toolchain: "zerocopy-aarch64-simd-1-59-0"
126+
toolchain: "no-zerocopy-aarch64-simd-1-59-0"
127127
- crate: "zerocopy-derive"
128-
toolchain: "zerocopy-panic-in-const-and-vec-try-reserve-1-57-0"
128+
toolchain: "no-zerocopy-panic-in-const-and-vec-try-reserve-1-57-0"
129129
# Exclude stable/wasm since wasm is no longer provided via rustup on
130130
# stable.
131131
- toolchain: "stable"
132132
target: "wasm32-unknown-unknown"
133-
# Exclude non-aarch64 targets from the `zerocopy-aarch64-simd-1-59-0`
133+
# Exclude non-aarch64 targets from the `no-zerocopy-aarch64-simd-1-59-0`
134134
# toolchain.
135-
- toolchain: "zerocopy-aarch64-simd-1-59-0"
135+
- toolchain: "no-zerocopy-aarch64-simd-1-59-0"
136136
target: "i686-unknown-linux-gnu"
137-
- toolchain: "zerocopy-aarch64-simd-1-59-0"
137+
- toolchain: "no-zerocopy-aarch64-simd-1-59-0"
138138
target: "x86_64-unknown-linux-gnu"
139-
- toolchain: "zerocopy-aarch64-simd-1-59-0"
139+
- toolchain: "no-zerocopy-aarch64-simd-1-59-0"
140140
target: "arm-unknown-linux-gnueabi"
141-
- toolchain: "zerocopy-aarch64-simd-1-59-0"
141+
- toolchain: "no-zerocopy-aarch64-simd-1-59-0"
142142
target: "powerpc-unknown-linux-gnu"
143-
- toolchain: "zerocopy-aarch64-simd-1-59-0"
143+
- toolchain: "no-zerocopy-aarch64-simd-1-59-0"
144144
target: "powerpc64-unknown-linux-gnu"
145-
- toolchain: "zerocopy-aarch64-simd-1-59-0"
145+
- toolchain: "no-zerocopy-aarch64-simd-1-59-0"
146146
target: "riscv64gc-unknown-linux-gnu"
147-
- toolchain: "zerocopy-aarch64-simd-1-59-0"
147+
- toolchain: "no-zerocopy-aarch64-simd-1-59-0"
148148
target: "s390x-unknown-linux-gnu"
149-
- toolchain: "zerocopy-aarch64-simd-1-59-0"
149+
- toolchain: "no-zerocopy-aarch64-simd-1-59-0"
150150
target: "x86_64-pc-windows-msvc"
151-
- toolchain: "zerocopy-aarch64-simd-1-59-0"
151+
- toolchain: "no-zerocopy-aarch64-simd-1-59-0"
152152
target: "thumbv6m-none-eabi"
153-
- toolchain: "zerocopy-aarch64-simd-1-59-0"
153+
- toolchain: "no-zerocopy-aarch64-simd-1-59-0"
154154
target: "wasm32-unknown-unknown"
155-
# Exclude most targets targets from the `zerocopy-core-error-1-81-0`
156-
# toolchain since the `zerocopy-core-error-1-81-0` feature is unrelated to
155+
# Exclude most targets targets from the `no-zerocopy-core-error-1-81-0`
156+
# toolchain since the `no-zerocopy-core-error-1-81-0` feature is unrelated to
157157
# compilation target. This only leaves i686 and x86_64 targets.
158-
- toolchain: "zerocopy-core-error-1-81-0"
158+
- toolchain: "no-zerocopy-core-error-1-81-0"
159159
target: "arm-unknown-linux-gnueabi"
160-
- toolchain: "zerocopy-core-error-1-81-0"
160+
- toolchain: "no-zerocopy-core-error-1-81-0"
161161
target: "aarch64-unknown-linux-gnu"
162-
- toolchain: "zerocopy-core-error-1-81-0"
162+
- toolchain: "no-zerocopy-core-error-1-81-0"
163163
target: "powerpc-unknown-linux-gnu"
164-
- toolchain: "zerocopy-core-error-1-81-0"
164+
- toolchain: "no-zerocopy-core-error-1-81-0"
165165
target: "powerpc64-unknown-linux-gnu"
166-
- toolchain: "zerocopy-core-error-1-81-0"
166+
- toolchain: "no-zerocopy-core-error-1-81-0"
167167
target: "riscv64gc-unknown-linux-gnu"
168-
- toolchain: "zerocopy-core-error-1-81-0"
168+
- toolchain: "no-zerocopy-core-error-1-81-0"
169169
target: "s390x-unknown-linux-gnu"
170-
- toolchain: "zerocopy-core-error-1-81-0"
170+
- toolchain: "no-zerocopy-core-error-1-81-0"
171171
target: "x86_64-pc-windows-msvc"
172-
- toolchain: "zerocopy-core-error-1-81-0"
172+
- toolchain: "no-zerocopy-core-error-1-81-0"
173173
target: "thumbv6m-none-eabi"
174-
- toolchain: "zerocopy-core-error-1-81-0"
174+
- toolchain: "no-zerocopy-core-error-1-81-0"
175175
target: "wasm32-unknown-unknown"
176176
# Exclude most targets targets from the
177-
# `zerocopy-diagnostic-on-unimplemented-1-78-0` toolchain since the
178-
# `zerocopy-diagnostic-on-unimplemented-1-78-0` feature is unrelated to
177+
# `no-zerocopy-diagnostic-on-unimplemented-1-78-0` toolchain since the
178+
# `no-zerocopy-diagnostic-on-unimplemented-1-78-0` feature is unrelated to
179179
# compilation target. This only leaves i686 and x86_64 targets.
180-
- toolchain: "zerocopy-diagnostic-on-unimplemented-1-78-0"
180+
- toolchain: "no-zerocopy-diagnostic-on-unimplemented-1-78-0"
181181
target: "arm-unknown-linux-gnueabi"
182-
- toolchain: "zerocopy-diagnostic-on-unimplemented-1-78-0"
182+
- toolchain: "no-zerocopy-diagnostic-on-unimplemented-1-78-0"
183183
target: "aarch64-unknown-linux-gnu"
184-
- toolchain: "zerocopy-diagnostic-on-unimplemented-1-78-0"
184+
- toolchain: "no-zerocopy-diagnostic-on-unimplemented-1-78-0"
185185
target: "powerpc-unknown-linux-gnu"
186-
- toolchain: "zerocopy-diagnostic-on-unimplemented-1-78-0"
186+
- toolchain: "no-zerocopy-diagnostic-on-unimplemented-1-78-0"
187187
target: "powerpc64-unknown-linux-gnu"
188-
- toolchain: "zerocopy-diagnostic-on-unimplemented-1-78-0"
188+
- toolchain: "no-zerocopy-diagnostic-on-unimplemented-1-78-0"
189189
target: "riscv64gc-unknown-linux-gnu"
190-
- toolchain: "zerocopy-diagnostic-on-unimplemented-1-78-0"
190+
- toolchain: "no-zerocopy-diagnostic-on-unimplemented-1-78-0"
191191
target: "s390x-unknown-linux-gnu"
192-
- toolchain: "zerocopy-diagnostic-on-unimplemented-1-78-0"
192+
- toolchain: "no-zerocopy-diagnostic-on-unimplemented-1-78-0"
193193
target: "x86_64-pc-windows-msvc"
194-
- toolchain: "zerocopy-diagnostic-on-unimplemented-1-78-0"
194+
- toolchain: "no-zerocopy-diagnostic-on-unimplemented-1-78-0"
195195
target: "thumbv6m-none-eabi"
196-
- toolchain: "zerocopy-diagnostic-on-unimplemented-1-78-0"
196+
- toolchain: "no-zerocopy-diagnostic-on-unimplemented-1-78-0"
197197
target: "wasm32-unknown-unknown"
198198
# Exclude most targets targets from the
199-
# `zerocopy-generic-bounds-in-const-fn-1-61-0` toolchain since the
200-
# `zerocopy-generic-bounds-in-const-fn-1-61-0` feature is unrelated to
199+
# `no-zerocopy-generic-bounds-in-const-fn-1-61-0` toolchain since the
200+
# `no-zerocopy-generic-bounds-in-const-fn-1-61-0` feature is unrelated to
201201
# compilation target. This only leaves i686 and x86_64 targets.
202-
- toolchain: "zerocopy-generic-bounds-in-const-fn-1-61-0"
202+
- toolchain: "no-zerocopy-generic-bounds-in-const-fn-1-61-0"
203203
target: "arm-unknown-linux-gnueabi"
204-
- toolchain: "zerocopy-generic-bounds-in-const-fn-1-61-0"
204+
- toolchain: "no-zerocopy-generic-bounds-in-const-fn-1-61-0"
205205
target: "aarch64-unknown-linux-gnu"
206-
- toolchain: "zerocopy-generic-bounds-in-const-fn-1-61-0"
206+
- toolchain: "no-zerocopy-generic-bounds-in-const-fn-1-61-0"
207207
target: "powerpc-unknown-linux-gnu"
208-
- toolchain: "zerocopy-generic-bounds-in-const-fn-1-61-0"
208+
- toolchain: "no-zerocopy-generic-bounds-in-const-fn-1-61-0"
209209
target: "powerpc64-unknown-linux-gnu"
210-
- toolchain: "zerocopy-generic-bounds-in-const-fn-1-61-0"
210+
- toolchain: "no-zerocopy-generic-bounds-in-const-fn-1-61-0"
211211
target: "riscv64gc-unknown-linux-gnu"
212-
- toolchain: "zerocopy-generic-bounds-in-const-fn-1-61-0"
212+
- toolchain: "no-zerocopy-generic-bounds-in-const-fn-1-61-0"
213213
target: "s390x-unknown-linux-gnu"
214-
- toolchain: "zerocopy-generic-bounds-in-const-fn-1-61-0"
214+
- toolchain: "no-zerocopy-generic-bounds-in-const-fn-1-61-0"
215215
target: "x86_64-pc-windows-msvc"
216-
- toolchain: "zerocopy-generic-bounds-in-const-fn-1-61-0"
216+
- toolchain: "no-zerocopy-generic-bounds-in-const-fn-1-61-0"
217217
target: "thumbv6m-none-eabi"
218-
- toolchain: "zerocopy-generic-bounds-in-const-fn-1-61-0"
218+
- toolchain: "no-zerocopy-generic-bounds-in-const-fn-1-61-0"
219219
target: "wasm32-unknown-unknown"
220220
# Exclude `thumbv6m-none-eabi` combined with any feature that implies
221221
# the `std` feature since `thumbv6m-none-eabi` does not include a

Cargo.toml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,38 +28,38 @@ exclude = [".*"]
2828

2929
[package.metadata.build-rs]
3030
# These key/value pairs are parsed by `build.rs`. Each entry names a `--cfg`
31-
# which will be emitted if zerocopy is built with a toolchain version at least
32-
# as high as the specified version. In the emitted `--cfg`, dashes are replaced
33-
# by underscores.
31+
# which will be emitted if zerocopy is built with a toolchain version *lower*
32+
# than the specified version. In the emitted `--cfg`, dashes are replaced by
33+
# underscores.
3434
#
3535
# Each name is suffixed with the version it corresponds to. This is a convention
3636
# used in the codebase to make it less likely for us to make mistakes when
3737
# writing `doc_cfg` attributes.
3838

3939
# From 1.89.0, Rust supports x86 AVX-12 SIMD types (previously gated by the
4040
# `stdarch_x86_avx512` feature).
41-
zerocopy-simd-x86-avx12-1-89-0 = "1.89.0"
41+
no-zerocopy-simd-x86-avx12-1-89-0 = "1.89.0"
4242

4343
# From 1.81.0, Rust supports the `core::error::Error` trait.
44-
zerocopy-core-error-1-81-0 = "1.81.0"
44+
no-zerocopy-core-error-1-81-0 = "1.81.0"
4545

4646
# From 1.78.0, Rust supports the `#[diagnostic::on_unimplemented]` attribute.
47-
zerocopy-diagnostic-on-unimplemented-1-78-0 = "1.78.0"
47+
no-zerocopy-diagnostic-on-unimplemented-1-78-0 = "1.78.0"
4848

4949
# From 1.61.0, Rust supports generic types with trait bounds in `const fn`.
50-
zerocopy-generic-bounds-in-const-fn-1-61-0 = "1.61.0"
50+
no-zerocopy-generic-bounds-in-const-fn-1-61-0 = "1.61.0"
5151

5252
# From 1.60.0, Rust supports `cfg(target_has_atomics)`, which allows us to
5353
# detect whether a target supports particular sets of atomics.
54-
zerocopy-target-has-atomics-1-60-0 = "1.60.0"
54+
no-zerocopy-target-has-atomics-1-60-0 = "1.60.0"
5555

5656
# When the "simd" feature is enabled, include SIMD types from the
5757
# `core::arch::aarch64` module, which was stabilized in 1.59.0. On earlier Rust
5858
# versions, these types require the "simd-nightly" feature.
59-
zerocopy-aarch64-simd-1-59-0 = "1.59.0"
59+
no-zerocopy-aarch64-simd-1-59-0 = "1.59.0"
6060

6161
# Permit panicking in `const fn`s and calling `Vec::try_reserve`.
62-
zerocopy-panic-in-const-and-vec-try-reserve-1-57-0 = "1.57.0"
62+
no-zerocopy-panic-in-const-and-vec-try-reserve-1-57-0 = "1.57.0"
6363

6464
[package.metadata.ci]
6565
# The versions of the stable and nightly compiler toolchains to use in CI.

build.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ fn main() {
9595
}
9696

9797
for version_cfg in version_cfgs {
98-
if rustc_version >= version_cfg.version {
98+
if rustc_version < version_cfg.version {
9999
println!("cargo:rustc-cfg={}", version_cfg.cfg_name);
100100
}
101101
}

src/error.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -115,14 +115,14 @@
115115
//! .map_err(|err| err.to_string())
116116
//! }).join().unwrap();
117117
//! ```
118-
#[cfg(zerocopy_core_error_1_81_0)]
118+
#[cfg(not(no_zerocopy_core_error_1_81_0))]
119119
use core::error::Error;
120120
use core::{
121121
convert::Infallible,
122122
fmt::{self, Debug, Write},
123123
ops::Deref,
124124
};
125-
#[cfg(all(not(zerocopy_core_error_1_81_0), any(feature = "std", test)))]
125+
#[cfg(all(no_zerocopy_core_error_1_81_0, any(feature = "std", test)))]
126126
use std::error::Error;
127127

128128
use crate::{util::SendSyncPhantomData, KnownLayout, TryFromBytes, Unaligned};
@@ -234,7 +234,7 @@ impl<A: fmt::Display, S: fmt::Display, V: fmt::Display> fmt::Display for Convert
234234
}
235235
}
236236

237-
#[cfg(any(zerocopy_core_error_1_81_0, feature = "std", test))]
237+
#[cfg(any(not(no_zerocopy_core_error_1_81_0), feature = "std", test))]
238238
#[cfg_attr(doc_cfg, doc(cfg(all(rust = "1.81.0", feature = "std"))))]
239239
impl<A, S, V> Error for ConvertError<A, S, V>
240240
where
@@ -407,7 +407,7 @@ where
407407
}
408408
}
409409

410-
#[cfg(any(zerocopy_core_error_1_81_0, feature = "std", test))]
410+
#[cfg(any(not(no_zerocopy_core_error_1_81_0), feature = "std", test))]
411411
#[cfg_attr(doc_cfg, doc(cfg(all(rust = "1.81.0", feature = "std"))))]
412412
impl<Src, Dst: ?Sized> Error for AlignmentError<Src, Dst>
413413
where
@@ -568,7 +568,7 @@ where
568568
}
569569
}
570570

571-
#[cfg(any(zerocopy_core_error_1_81_0, feature = "std", test))]
571+
#[cfg(any(not(no_zerocopy_core_error_1_81_0), feature = "std", test))]
572572
#[cfg_attr(doc_cfg, doc(cfg(all(rust = "1.81.0", feature = "std"))))]
573573
impl<Src, Dst: ?Sized> Error for SizeError<Src, Dst>
574574
where
@@ -689,7 +689,7 @@ where
689689
}
690690
}
691691

692-
#[cfg(any(zerocopy_core_error_1_81_0, feature = "std", test))]
692+
#[cfg(any(not(no_zerocopy_core_error_1_81_0), feature = "std", test))]
693693
#[cfg_attr(doc_cfg, doc(cfg(all(rust = "1.81.0", feature = "std"))))]
694694
impl<Src, Dst: ?Sized> Error for ValidityError<Src, Dst> where Dst: KnownLayout + TryFromBytes {}
695695

src/impls.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ const _: () = unsafe {
390390
};
391391

392392
#[cfg(all(
393-
zerocopy_target_has_atomics_1_60_0,
393+
not(no_zerocopy_target_has_atomics_1_60_0),
394394
any(
395395
target_has_atomic = "8",
396396
target_has_atomic = "16",
@@ -1074,7 +1074,7 @@ mod simd {
10741074
#[cfg(target_arch = "x86")]
10751075
x86, x86, __m128, __m128d, __m128i, __m256, __m256d, __m256i
10761076
);
1077-
#[cfg(zerocopy_simd_x86_avx12_1_89_0)]
1077+
#[cfg(not(no_zerocopy_simd_x86_avx12_1_89_0))]
10781078
simd_arch_mod!(
10791079
#[cfg(target_arch = "x86")]
10801080
#[cfg_attr(doc_cfg, doc(cfg(rust = "1.89.0")))]
@@ -1084,7 +1084,7 @@ mod simd {
10841084
#[cfg(target_arch = "x86_64")]
10851085
x86_64, x86_64, __m128, __m128d, __m128i, __m256, __m256d, __m256i
10861086
);
1087-
#[cfg(zerocopy_simd_x86_avx12_1_89_0)]
1087+
#[cfg(not(no_zerocopy_simd_x86_avx12_1_89_0))]
10881088
simd_arch_mod!(
10891089
#[cfg(target_arch = "x86_64")]
10901090
#[cfg_attr(doc_cfg, doc(cfg(rust = "1.89.0")))]
@@ -1102,7 +1102,7 @@ mod simd {
11021102
#[cfg(all(feature = "simd-nightly", target_arch = "powerpc64"))]
11031103
powerpc64, powerpc64, vector_bool_long, vector_double, vector_signed_long, vector_unsigned_long
11041104
);
1105-
#[cfg(zerocopy_aarch64_simd_1_59_0)]
1105+
#[cfg(not(no_zerocopy_aarch64_simd_1_59_0))]
11061106
simd_arch_mod!(
11071107
// NOTE(https://github.com/rust-lang/stdarch/issues/1484): NEON intrinsics are currently
11081108
// broken on big-endian platforms.
@@ -2075,13 +2075,13 @@ mod tests {
20752075
#[cfg(target_arch = "x86")]
20762076
test_simd_arch_mod!(x86, __m128, __m128d, __m128i, __m256, __m256d, __m256i);
20772077

2078-
#[cfg(all(zerocopy_simd_x86_avx12_1_89_0, target_arch = "x86"))]
2078+
#[cfg(all(not(no_zerocopy_simd_x86_avx12_1_89_0), target_arch = "x86"))]
20792079
test_simd_arch_mod!(x86, __m512bh, __m512, __m512d, __m512i);
20802080

20812081
#[cfg(target_arch = "x86_64")]
20822082
test_simd_arch_mod!(x86_64, __m128, __m128d, __m128i, __m256, __m256d, __m256i);
20832083

2084-
#[cfg(all(zerocopy_simd_x86_avx12_1_89_0, target_arch = "x86_64"))]
2084+
#[cfg(all(not(no_zerocopy_simd_x86_avx12_1_89_0), target_arch = "x86_64"))]
20852085
test_simd_arch_mod!(x86_64, __m512bh, __m512, __m512d, __m512i);
20862086

20872087
#[cfg(target_arch = "wasm32")]
@@ -2104,7 +2104,7 @@ mod tests {
21042104
vector_signed_long,
21052105
vector_unsigned_long
21062106
);
2107-
#[cfg(all(target_arch = "aarch64", zerocopy_aarch64_simd_1_59_0))]
2107+
#[cfg(all(target_arch = "aarch64", not(no_zerocopy_aarch64_simd_1_59_0)))]
21082108
#[rustfmt::skip]
21092109
test_simd_arch_mod!(
21102110
aarch64, float32x2_t, float32x4_t, float64x1_t, float64x2_t, int8x8_t, int8x8x2_t,

src/layout.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1246,7 +1246,7 @@ mod tests {
12461246
layout(size_info, align).validate_cast_and_convert_metadata(addr, bytes_len, cast_type)
12471247
}).map_err(|d| {
12481248
let msg = d.downcast::<&'static str>().ok().map(|s| *s.as_ref());
1249-
assert!(msg.is_some() || cfg!(not(zerocopy_panic_in_const_and_vec_try_reserve_1_57_0)), "non-string panic messages are not permitted when `--cfg zerocopy_panic_in_const_and_vec_try_reserve` is set");
1249+
assert!(msg.is_some() || cfg!(no_zerocopy_panic_in_const_and_vec_try_reserve_1_57_0), "non-string panic messages are not permitted when usage of panic in const fn is enabled");
12501250
msg
12511251
});
12521252
std::panic::set_hook(previous_hook);

0 commit comments

Comments
 (0)