Subject
zerocopy is a Google-maintained Rust library that provides safe, zero-cost conversions between byte sequences and typed values. It is a no_std-by-default crate that exposes derivable marker and conversion traits (KnownLayout, Immutable, Unaligned, TryFromBytes, FromZeros, FromBytes, IntoBytes), conversion macros (transmute/transmute_ref/transmute_mut and their try_ variants), and byte-order-aware integer wrappers (U16, I16, U32, …) used for parsing wire formats. It is consumed extensively across the Rust ecosystem (hypervisors, cryptographic implementations, firmware) as a foundation for safer transmutation.
Methodology
The published crate (zerocopy-0.8.48.crate) was compared against the upstream Git repository at the commit recorded in .cargo_vcs_info.json (aa7c31671cb5ce509551edafa23c6865df83b180, "Release 0.8.48"); Cargo.toml.orig matched vcs/Cargo.toml byte-for-byte and the remaining differences were limited to cargo's standard normalisation (auto-generated Cargo.toml, omitted dotfiles excluded via exclude = [".*"], workspace-only siblings: testutil/, tools/, vendor/, zerocopy-derive/).
The crate's metadata (Cargo.toml, README.md, CHANGELOG.md, POLICIES.md, AGENTS.md, CONTRIBUTING.md) was read in full. The build script (build.rs, ~260 lines) was read in full and reasoned about. The crate's ~28k Rust source lines under src/ (lib.rs, impls.rs, layout.rs, macros.rs, byteorder.rs, ref.rs, split_at.rs, wrappers.rs, error.rs, byte_slice.rs, pointer/*, util/*) were surveyed for unsafe, FFI, network/filesystem/process/environment/concurrency usage, and representative unsafe impls were read in detail (src/impls.rs:19-200, src/byte_slice.rs:100-340, src/pointer/inner.rs:1-200, src/lib.rs:3560-3760). The 21 occurrences of FIXME(#429) were enumerated. The integration-test entry points (tests/codegen.rs, tests/include.rs, tests/ui.rs) were read; the CI workflow (.github/workflows/ci.yml) was inspected to confirm which test backends run.
Results
The published artefact matches the upstream VCS commit. The crate ships no binary artefacts (justifying has-binaries) and no installation-time hooks (cargo provides no install step; justifying has-install-exec).
The crate ships a build.rs whose presence justifies has-build-exec. As described in the file annotation, the script reads the crate-root Cargo.toml, parses the [package.metadata.build-rs] table to determine which --cfg no-zerocopy-… flags to emit, and invokes rustc --version via the documented RUSTC Cargo variable; no other files are read, no other processes are spawned, no network access occurs, output is restricted to cargo: directives and is a pure function of the rustc version and Cargo.toml. This justifies build-exec-safe, build-exec-deterministic, build-exec-no-network, build-exec-no-write-out, and build-exec-minimal.
The codebase was searched for network primitives (TcpStream, UdpSocket, reqwest, ureq), filesystem operations (std::fs, std::process, Command), and environment access (std::env); no occurrences appeared outside of doc-comment examples (justifying uses-network, uses-filesystem, uses-environment, and uses-exec). The crate is no_std by default, and even with std enabled it does not spawn threads, depend on an async runtime, or implement synchronisation primitives — the standard library's Atomic* types are referenced only to derive FromBytes/IntoBytes/TryFromBytes impls (src/impls.rs:455-565), so the crate does not itself use concurrency in the sense of uses-concurrency. No cryptographic operations, JIT, or embedded interpreters appear in the source (justifying uses-crypto, uses-jit, uses-interpreter).
zerocopy is fundamentally an unsafe-code library (~110 unsafe impls and ~107 unsafe { … } blocks across src/), justifying uses-unsafe. The library's existence — providing safe traits over operations that would otherwise require callers to write unsafe — supports unsafe-minimal: every unsafe block is in service of an abstraction that removes the need for unsafe in client code. Soundness is taken seriously: every non-test unsafe block is required by POLICIES.md to carry a safety comment that quotes the stable Rust documentation it relies on, with clippy::undocumented_unsafe_blocks enforcing the policy. Sampled blocks (e.g. src/impls.rs:19-200, src/pointer/inner.rs) follow this convention with stable-version-pinned doc.rust-lang.org links and verbatim quotations of the Reference. The CI matrix runs the test suite under Miri (with both -Zmiri-strict-provenance and -Zmiri-tree-borrows), under Kani for formal verification of layout/padding/byteorder routines (src/byte_slice.rs:372, src/layout.rs:1999-2176, src/util/mod.rs:153,237), under -Zrandomize-layout, and across multiple targets including big-endian aarch64 and AVR; combined with the ~114 #[test] functions, this justifies unsafe-tested. The combination of policy-enforced safety reasoning, Miri's UB detection, and Kani's formal proofs supports unsafe-safe.
One low-severity quality finding (FINDING-1) was recorded: 21 unsafe blocks bear FIXME(#429) markers and #[allow(clippy::undocumented_unsafe_blocks)] instead of the required safety comment. Their soundness is not in question — the invariants are documented elsewhere — but the gap prevents unsafe-documented from being asserted true. The gap is openly tracked upstream.
zerocopy does not implement cryptography, parsers of a wire format (it produces typed views into byte sequences supplied by the caller; the byte-order wrappers like U16<BigEndian> rearrange bytes but do not parse a grammar), interpreters, JITs, network protocols, novel data structures, or non-trivial algorithms, justifying impl-crypto, impl-parser, impl-interpreter, impl-jit, impl-protocol, impl-datastructure, impl-algorithm, and impl-concurrency.
The crate ships ~114 #[test] functions across src/, plus three integration-test entry points (tests/codegen.rs, tests/include.rs, tests/ui.rs) and a trybuild-driven UI test suite under tests/ui/, justifying has-unit-tests and has-integration-tests. No cargo-fuzz fuzz target or proptest/quickcheck property-test harness appears within this crate's source tree (justifying has-fuzz-tests and has-property-tests); the project relies instead on Kani formal proofs and Miri-driven randomised execution, which together provide stronger guarantees than typical property tests for the soundness-sensitive surface.
No code paths suggest data exfiltration, anti-analysis, time-bombs, network beacons, or typosquatting. Authorship, repository, and the upstream-matching VCS commit are consistent with a long-running Google-maintained project (the soundness regression history in CHANGELOG.md and the upstream-tracked #429 work indicate ongoing maintenance), justifying is-benign.
Conclusion
zerocopy 0.8.48 is a mature, security-focused Rust library whose engineering rigour materially exceeds that of typical crates: policy-enforced safety comments quoting stable Rust documentation, Miri runs under multiple aliasing models, Kani formal-verification proofs, randomized-layout testing, and cross-architecture CI. The single low-severity quality finding concerns 21 known-and-tracked undocumented unsafe blocks; their underlying soundness is not in dispute.