Skip to content

Commit d78ea72

Browse files
committed
Add optional zerocopy crate derives
1 parent a515d07 commit d78ea72

File tree

3 files changed

+5
-0
lines changed

3 files changed

+5
-0
lines changed

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ cargo-args = ["-Zbuild-std=core"]
132132

133133
[dependencies]
134134
rustc-std-workspace-core = { version = "1.0.0", optional = true }
135+
zerocopy_0_8 = { package = "zerocopy", version = "0.8.0-alpha.21", optional = true, features = ["derive"] }
135136

136137
[features]
137138
default = ["std"]

src/lib.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@
2828
#![cfg_attr(feature = "rustc-dep-of-std", no_core)]
2929
#![cfg_attr(libc_const_extern_fn_unstable, feature(const_extern_fn))]
3030

31+
#[cfg(feature = "zerocopy_0_8")]
32+
extern crate zerocopy_0_8 as zerocopy;
33+
3134
#[macro_use]
3235
mod macros;
3336

src/unix/bsd/apple/b64/aarch64/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
pub type boolean_t = ::c_int;
22

33
s! {
4+
#[cfg_attr(feature = "zerocopy", derive(zerocopy_0_8::FromBytes))]
45
pub struct malloc_zone_t {
56
__private: [::uintptr_t; 18], // FIXME: needs arm64 auth pointers support
67
}

0 commit comments

Comments
 (0)