Skip to content

Commit db51de7

Browse files
committed
Release 0.9.0-alpha.1
Bump MSRV to 1.78.0. gherrit-pr-id: Gswihhcmqo3istfrlivayevxcvnqhumln
1 parent 6eca852 commit db51de7

71 files changed

Lines changed: 2527 additions & 1363 deletions

File tree

Some content is hidden

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

.github/workflows/ci.yml

Lines changed: 0 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,7 @@ jobs:
6969
# which a particular feature is supported.
7070
"no-zerocopy-simd-x86-avx12-1-89-0",
7171
"no-zerocopy-core-error-1-81-0",
72-
"no-zerocopy-diagnostic-on-unimplemented-1-78-0",
73-
"no-zerocopy-generic-bounds-in-const-fn-1-61-0",
74-
"no-zerocopy-target-has-atomics-1-60-0",
75-
"no-zerocopy-aarch64-simd-1-59-0",
7672
"no-zerocopy-aarch64-simd-be-1-87-0",
77-
"no-zerocopy-panic-in-const-and-vec-try-reserve-1-57-0"
7873
]
7974
target: [
8075
"i686-unknown-linux-gnu",
@@ -108,18 +103,8 @@ jobs:
108103
features: "--all-features"
109104
- toolchain: "no-zerocopy-core-error-1-81-0"
110105
features: "--all-features"
111-
- toolchain: "no-zerocopy-diagnostic-on-unimplemented-1-78-0"
112-
features: "--all-features"
113-
- toolchain: "no-zerocopy-generic-bounds-in-const-fn-1-61-0"
114-
features: "--all-features"
115-
- toolchain: "no-zerocopy-target-has-atomics-1-60-0"
116-
features: "--all-features"
117-
- toolchain: "no-zerocopy-aarch64-simd-1-59-0"
118-
features: "--all-features"
119106
- toolchain: "no-zerocopy-aarch64-simd-be-1-87-0"
120107
features: "--all-features"
121-
- toolchain: "no-zerocopy-panic-in-const-and-vec-try-reserve-1-57-0"
122-
features: "--all-features"
123108
# Exclude any combination for the zerocopy-derive crate which
124109
# uses zerocopy features.
125110
- crate: "zerocopy-derive"
@@ -136,44 +121,12 @@ jobs:
136121
toolchain: "no-zerocopy-simd-x86-avx12-1-89-0"
137122
- crate: "zerocopy-derive"
138123
toolchain: "no-zerocopy-core-error-1-81-0"
139-
- crate: "zerocopy-derive"
140-
toolchain: "no-zerocopy-diagnostic-on-unimplemented-1-78-0"
141-
- crate: "zerocopy-derive"
142-
toolchain: "no-zerocopy-generic-bounds-in-const-fn-1-61-0"
143-
- crate: "zerocopy-derive"
144-
toolchain: "no-zerocopy-target-has-atomics-1-60-0"
145-
- crate: "zerocopy-derive"
146-
toolchain: "no-zerocopy-aarch64-simd-1-59-0"
147124
- crate: "zerocopy-derive"
148125
toolchain: "no-zerocopy-aarch64-simd-be-1-87-0"
149-
- crate: "zerocopy-derive"
150-
toolchain: "no-zerocopy-panic-in-const-and-vec-try-reserve-1-57-0"
151126
# Exclude stable/wasm since wasm is no longer provided via rustup on
152127
# stable.
153128
- toolchain: "stable"
154129
target: "wasm32-unknown-unknown"
155-
# Exclude non-aarch64 targets from the `no-zerocopy-aarch64-simd-1-59-0`
156-
# toolchain.
157-
- toolchain: "no-zerocopy-aarch64-simd-1-59-0"
158-
target: "i686-unknown-linux-gnu"
159-
- toolchain: "no-zerocopy-aarch64-simd-1-59-0"
160-
target: "x86_64-unknown-linux-gnu"
161-
- toolchain: "no-zerocopy-aarch64-simd-1-59-0"
162-
target: "arm-unknown-linux-gnueabi"
163-
- toolchain: "no-zerocopy-aarch64-simd-1-59-0"
164-
target: "powerpc-unknown-linux-gnu"
165-
- toolchain: "no-zerocopy-aarch64-simd-1-59-0"
166-
target: "powerpc64-unknown-linux-gnu"
167-
- toolchain: "no-zerocopy-aarch64-simd-1-59-0"
168-
target: "riscv64gc-unknown-linux-gnu"
169-
- toolchain: "no-zerocopy-aarch64-simd-1-59-0"
170-
target: "s390x-unknown-linux-gnu"
171-
- toolchain: "no-zerocopy-aarch64-simd-1-59-0"
172-
target: "x86_64-pc-windows-msvc"
173-
- toolchain: "no-zerocopy-aarch64-simd-1-59-0"
174-
target: "thumbv6m-none-eabi"
175-
- toolchain: "no-zerocopy-aarch64-simd-1-59-0"
176-
target: "wasm32-unknown-unknown"
177130
# Exclude non-aarch64 targets from the `no-zerocopy-aarch64-simd-be-1-87-0`
178131
# toolchain.
179132
- toolchain: "no-zerocopy-aarch64-simd-be-1-87-0"
@@ -217,50 +170,6 @@ jobs:
217170
target: "thumbv6m-none-eabi"
218171
- toolchain: "no-zerocopy-core-error-1-81-0"
219172
target: "wasm32-unknown-unknown"
220-
# Exclude most targets from the
221-
# `no-zerocopy-diagnostic-on-unimplemented-1-78-0` toolchain since the
222-
# `no-zerocopy-diagnostic-on-unimplemented-1-78-0` feature is unrelated to
223-
# compilation target. This only leaves i686 and x86_64 targets.
224-
- toolchain: "no-zerocopy-diagnostic-on-unimplemented-1-78-0"
225-
target: "arm-unknown-linux-gnueabi"
226-
- toolchain: "no-zerocopy-diagnostic-on-unimplemented-1-78-0"
227-
target: "aarch64-unknown-linux-gnu"
228-
- toolchain: "no-zerocopy-diagnostic-on-unimplemented-1-78-0"
229-
target: "powerpc-unknown-linux-gnu"
230-
- toolchain: "no-zerocopy-diagnostic-on-unimplemented-1-78-0"
231-
target: "powerpc64-unknown-linux-gnu"
232-
- toolchain: "no-zerocopy-diagnostic-on-unimplemented-1-78-0"
233-
target: "riscv64gc-unknown-linux-gnu"
234-
- toolchain: "no-zerocopy-diagnostic-on-unimplemented-1-78-0"
235-
target: "s390x-unknown-linux-gnu"
236-
- toolchain: "no-zerocopy-diagnostic-on-unimplemented-1-78-0"
237-
target: "x86_64-pc-windows-msvc"
238-
- toolchain: "no-zerocopy-diagnostic-on-unimplemented-1-78-0"
239-
target: "thumbv6m-none-eabi"
240-
- toolchain: "no-zerocopy-diagnostic-on-unimplemented-1-78-0"
241-
target: "wasm32-unknown-unknown"
242-
# Exclude most targets from the
243-
# `no-zerocopy-generic-bounds-in-const-fn-1-61-0` toolchain since the
244-
# `no-zerocopy-generic-bounds-in-const-fn-1-61-0` feature is unrelated to
245-
# compilation target. This only leaves i686 and x86_64 targets.
246-
- toolchain: "no-zerocopy-generic-bounds-in-const-fn-1-61-0"
247-
target: "arm-unknown-linux-gnueabi"
248-
- toolchain: "no-zerocopy-generic-bounds-in-const-fn-1-61-0"
249-
target: "aarch64-unknown-linux-gnu"
250-
- toolchain: "no-zerocopy-generic-bounds-in-const-fn-1-61-0"
251-
target: "powerpc-unknown-linux-gnu"
252-
- toolchain: "no-zerocopy-generic-bounds-in-const-fn-1-61-0"
253-
target: "powerpc64-unknown-linux-gnu"
254-
- toolchain: "no-zerocopy-generic-bounds-in-const-fn-1-61-0"
255-
target: "riscv64gc-unknown-linux-gnu"
256-
- toolchain: "no-zerocopy-generic-bounds-in-const-fn-1-61-0"
257-
target: "s390x-unknown-linux-gnu"
258-
- toolchain: "no-zerocopy-generic-bounds-in-const-fn-1-61-0"
259-
target: "x86_64-pc-windows-msvc"
260-
- toolchain: "no-zerocopy-generic-bounds-in-const-fn-1-61-0"
261-
target: "thumbv6m-none-eabi"
262-
- toolchain: "no-zerocopy-generic-bounds-in-const-fn-1-61-0"
263-
target: "wasm32-unknown-unknown"
264173
# Exclude `thumbv6m-none-eabi` combined with any feature that implies
265174
# the `std` feature since `thumbv6m-none-eabi` does not include a
266175
# pre-compiled std.

Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 14 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
[package]
1616
edition = "2021"
1717
name = "zerocopy"
18-
version = "0.8.48"
18+
version = "0.9.0-alpha.1"
1919
authors = [
2020
"Joshua Liebow-Feeser <[email protected]>",
2121
"Jack Wrenn <[email protected]>",
@@ -31,7 +31,8 @@ categories = [
3131
keywords = ["cast", "convert", "transmute", "transmutation", "type-punning"]
3232
license = "BSD-2-Clause OR Apache-2.0 OR MIT"
3333
repository = "https://github.com/google/zerocopy"
34-
rust-version = "1.56.0"
34+
# WARNING: Consult with the Rust for Linux project before increasing.
35+
rust-version = "1.78.0"
3536

3637
exclude = [".*"]
3738

@@ -64,43 +65,31 @@ no-zerocopy-simd-x86-avx12-1-89-0 = "1.89.0"
6465
# From 1.81.0, Rust supports the `core::error::Error` trait.
6566
no-zerocopy-core-error-1-81-0 = "1.81.0"
6667

67-
# From 1.78.0, Rust supports the `#[diagnostic::on_unimplemented]` attribute.
68-
no-zerocopy-diagnostic-on-unimplemented-1-78-0 = "1.78.0"
69-
70-
# From 1.61.0, Rust supports generic types with trait bounds in `const fn`.
71-
no-zerocopy-generic-bounds-in-const-fn-1-61-0 = "1.61.0"
72-
73-
# From 1.60.0, Rust supports `cfg(target_has_atomics)`, which allows us to
74-
# detect whether a target supports particular sets of atomics.
75-
no-zerocopy-target-has-atomics-1-60-0 = "1.60.0"
76-
77-
# When the "simd" feature is enabled, include SIMD types from the
78-
# `core::arch::aarch64` module, which was stabilized in 1.59.0. On earlier Rust
79-
# versions, these types require the "simd-nightly" feature.
80-
no-zerocopy-aarch64-simd-1-59-0 = "1.59.0"
81-
8268
# Include SIMD types from `core::arch::aarch64` on big endian targets. Prior to
8369
# 1.87.0 (https://github.com/rust-lang/rust/pull/136831) the types were only
8470
# correct on little endian and backed off from stable in a breaking change.
8571
no-zerocopy-aarch64-simd-be-1-87-0 = "1.87.0"
8672

87-
# Permit panicking in `const fn`s and calling `Vec::try_reserve`.
88-
no-zerocopy-panic-in-const-and-vec-try-reserve-1-57-0 = "1.57.0"
89-
9073
[package.metadata.ci]
9174
# The versions of the stable and nightly compiler toolchains to use in CI.
9275
pinned-stable = "1.93.1"
9376
pinned-nightly = "nightly-2026-01-25"
9477

9578
[package.metadata.docs.rs]
9679
all-features = true
97-
rustdoc-args = ["--cfg", "doc_cfg", "--generate-link-to-definition", "--extend-css", "rustdoc/style.css"]
80+
rustdoc-args = [
81+
"--cfg",
82+
"doc_cfg",
83+
"--generate-link-to-definition",
84+
"--extend-css",
85+
"rustdoc/style.css",
86+
]
9887
targets = [
9988
"x86_64-unknown-linux-gnu",
10089
"x86_64-apple-darwin",
10190
"x86_64-pc-windows-msvc",
10291
"i686-unknown-linux-gnu",
103-
"i686-pc-windows-msvc"
92+
"i686-pc-windows-msvc",
10493
]
10594

10695
[package.metadata.playground]
@@ -124,13 +113,13 @@ __internal_use_only_features_that_work_on_stable = [
124113
]
125114

126115
[dependencies]
127-
zerocopy-derive = { version = "=0.8.48", path = "zerocopy-derive", optional = true }
116+
zerocopy-derive = { version = "=0.9.0-alpha.1", path = "zerocopy-derive", optional = true }
128117

129118
# The "associated proc macro pattern" ensures that the versions of zerocopy and
130119
# zerocopy-derive remain equal, even if the 'derive' feature isn't used.
131120
# See: https://github.com/matklad/macro-dep-test
132121
[target.'cfg(any())'.dependencies]
133-
zerocopy-derive = { version = "=0.8.48", path = "zerocopy-derive" }
122+
zerocopy-derive = { version = "=0.9.0-alpha.1", path = "zerocopy-derive" }
134123

135124
[dev-dependencies]
136125
# FIXME(#381) Remove this dependency once we have our own layout gadgets.
@@ -142,4 +131,4 @@ rustversion = "1.0"
142131
static_assertions = "1.1"
143132
testutil = { path = "testutil" }
144133
# In tests, unlike in production, zerocopy-derive is not optional
145-
zerocopy-derive = { version = "=0.8.48", path = "zerocopy-derive" }
134+
zerocopy-derive = { version = "=0.9.0-alpha.1", path = "zerocopy-derive" }

POLICIES.md

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,21 +89,36 @@ documented guarantees do not hold.
8989

9090
## MSRV
9191

92+
TL;DR:
93+
- 0.8 is our long-term stability (LTS) release train. On 0.8, we consider MSRV bumps to be breaking changes.
94+
- On 0.9, we do *not* consider MSRV bumps to be breaking changes.
95+
96+
### 0.8
97+
9298
<!-- Our policy used to be simply that MSRV was a breaking change in all
9399
circumstances. This implicitly relied on syn having the same MSRV policy, which
94100
it does not. See #1085 and #1088. -->
95101

102+
*This section only applies to the 0.8 version train.*
103+
96104
Without the `derive` feature enabled, zerocopy's minimum supported Rust version
97105
(MSRV) is encoded the `package.rust-version` field in its `Cargo.toml` file. For
98-
zerocopy, we consider an increase in MSRV to be a semver-breaking change, and
99-
will only increase our MSRV during semver-breaking version changes (e.g., 0.1 ->
100-
0.2, 1.0 -> 2.0, etc).
106+
zerocopy, we consider an increase in MSRV to be a semver-breaking change. We
107+
will not bump our MSRV on the 0.8 version train.
101108

102109
For zerocopy with the `derive` feature enabled, and for the zerocopy-derive
103110
crate, we inherit the maximum MSRV any of our dependencies. As of this writing
104111
(2024-10-03), at least one dependency (syn) does *not* consider MSRV increases
105112
to be semver-breaking changes. Thus, using the `derive` feature may result in
106-
the effective MSRV increasing within a semver version train.
113+
the effective MSRV increasing within 0.8.
114+
115+
### 0.9
116+
117+
*This section only applies to the 0.9 version train.*
118+
119+
0.9 has no official MSRV policy. We do not consider MSRV bumps to be breaking
120+
changes. We may adopt *some* MSRV policy in the future, but we make no
121+
guarantees about what it will be.
107122

108123
## Yanking
109124

agent_docs/development.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ This is equivalent to:
3333
`cargo +1.2.3 <command> [args]`
3434

3535
...where `1.2.3` is the toolchain version named by `<toolchain>` (e.g., `msrv` ->
36-
`1.56.0`).
36+
`1.78.0`).
3737

3838
### Toolchains
3939

@@ -47,12 +47,12 @@ The `<toolchain>` argument is mandatory:
4747

4848
## MSRV (Minimum Supported Rust Version)
4949

50-
The MSRV is **1.56.0**.
50+
The MSRV is **1.78.0**.
5151

52-
- **Do NOT** use features stabilized after 1.56.0 unless version-gated.
52+
- **Do NOT** use features stabilized after 1.78.0 unless version-gated.
5353
- **Requirement:** Ask for user approval before introducing new version-gated
5454
behavior.
55-
- **Verify**: Ensure code compiles on 1.56.0 (`./cargo.sh +msrv ...`).
55+
- **Verify**: Ensure code compiles on 1.78.0 (`./cargo.sh +msrv ...`).
5656

5757
### Version Gating Convention
5858

src/byteorder.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1059,8 +1059,8 @@ mod tests {
10591059
/// themselves. This method is like `assert_eq!`, but it treats NaN
10601060
/// values as equal.
10611061
fn assert_eq_or_nan(self, other: Self) {
1062-
let slf = (!self.is_nan()).then(|| self);
1063-
let other = (!other.is_nan()).then(|| other);
1062+
let slf = (!self.is_nan()).then_some(self);
1063+
let other = (!other.is_nan()).then_some(other);
10641064
assert_eq!(slf, other);
10651065
}
10661066
}
@@ -1090,8 +1090,8 @@ mod tests {
10901090
/// themselves. This method is like `assert_eq!`, but it treats NaN
10911091
/// values as equal.
10921092
fn assert_eq_or_nan(self, other: Self) {
1093-
let slf = (!self.get().is_nan()).then(|| self);
1094-
let other = (!other.get().is_nan()).then(|| other);
1093+
let slf = (!self.get().is_nan()).then_some(self);
1094+
let other = (!other.get().is_nan()).then_some(other);
10951095
assert_eq!(slf, other);
10961096
}
10971097
}
@@ -1401,7 +1401,7 @@ mod tests {
14011401
let t_t_res = val_or_none(t_t_res);
14021402
let t_n_res = val_or_none(t_n_res);
14031403
let n_t_res = val_or_none(n_t_res);
1404-
let n_n_res = (!T::Native::is_nan(n_n_res)).then(|| n_n_res);
1404+
let n_n_res = (!T::Native::is_nan(n_n_res)).then_some(n_n_res);
14051405
assert_eq!(t_t_res, n_n_res);
14061406
assert_eq!(t_n_res, n_n_res);
14071407
assert_eq!(n_t_res, n_n_res);
@@ -1419,7 +1419,7 @@ mod tests {
14191419
// NaN as `None` so they can still be compared.
14201420
let t_t_res = val_or_none(t_t_res);
14211421
let t_n_res = val_or_none(t_n_res);
1422-
let n_t_res = (!T::Native::is_nan(n_t_res)).then(|| n_t_res);
1422+
let n_t_res = (!T::Native::is_nan(n_t_res)).then_some(n_t_res);
14231423
assert_eq!(t_t_res, n_n_res);
14241424
assert_eq!(t_n_res, n_n_res);
14251425
assert_eq!(n_t_res, n_n_res);

src/impls.rs

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -383,15 +383,12 @@ const _: () = unsafe {
383383
unsafe_impl_for_power_set!(A, B, C, D, E, F, G, H, I, J, K, L -> M => Immutable for opt_unsafe_extern_c_fn!(...));
384384
};
385385

386-
#[cfg(all(
387-
not(no_zerocopy_target_has_atomics_1_60_0),
388-
any(
389-
target_has_atomic = "8",
390-
target_has_atomic = "16",
391-
target_has_atomic = "32",
392-
target_has_atomic = "64",
393-
target_has_atomic = "ptr"
394-
)
386+
#[cfg(any(
387+
target_has_atomic = "8",
388+
target_has_atomic = "16",
389+
target_has_atomic = "32",
390+
target_has_atomic = "64",
391+
target_has_atomic = "ptr"
395392
))]
396393
#[cfg_attr(doc_cfg, doc(cfg(rust = "1.60.0")))]
397394
mod atomics {
@@ -1354,7 +1351,6 @@ mod simd {
13541351
// Rust 1.87. (Context in https://github.com/rust-lang/stdarch/issues/1484). Support is
13551352
// split in two different version ranges on top of the base configuration, requiring either
13561353
// little endian or the more recent version to be detected as well.
1357-
#[cfg(not(no_zerocopy_aarch64_simd_1_59_0))]
13581354
simd_arch_mod!(
13591355
#[cfg(all(
13601356
target_arch = "aarch64",
@@ -2371,7 +2367,7 @@ mod tests {
23712367
vector_signed_long,
23722368
vector_unsigned_long
23732369
);
2374-
#[cfg(all(target_arch = "aarch64", not(no_zerocopy_aarch64_simd_1_59_0)))]
2370+
#[cfg(target_arch = "aarch64")]
23752371
#[rustfmt::skip]
23762372
test_simd_arch_mod!(
23772373
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
@@ -1390,7 +1390,7 @@ mod tests {
13901390
layout(size_info, align).validate_cast_and_convert_metadata(addr, bytes_len, cast_type)
13911391
}).map_err(|d| {
13921392
let msg = d.downcast::<&'static str>().ok().map(|s| *s.as_ref());
1393-
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");
1393+
assert!(msg.is_some(), "non-string panic messages are not permitted when usage of panic in const fn is enabled");
13941394
msg
13951395
});
13961396
std::panic::set_hook(previous_hook);

0 commit comments

Comments
 (0)