#Zerocopy
welp, i just had a *really bad* experience (related to Cargo feature flags, naturally) which I feel is probably worth sharing so that others can not fall victim to this footgun: github.com/oxidecompute...
Unbreak sad `zerocopy-derive` import conflict by hawkw · Pull Request #9 · oxidecomputer/humpty
So, it turns out that the strategy of depending on zerocopy and zerocopy-derive separately (as suggested by the Zerocopy authors and also by @cbiffle in [this comment][1]) has a really unfortunate ...
github.com
May 7, 2025 at 8:59 PM
This is neat: with sufficiently careful struct layout, I can pack an opcode word into 8 bytes, be zerocopy-friendly, still have non-terrible ergonomics, and keep all of the fields correctly aligned!
September 10, 2026 at 5:57 PM
So I looked through some more reasons for why zerocopy now shows up in my dependency tree and from what I can tell it's all coming from the zerocopy developers themselves making PRs against other crates introducing the dependency. Not sure what to think of that.
February 5, 2025 at 3:11 PM
highlighting this banger comment from Alice on the Rust subreddit
February 3, 2025 at 5:07 PM
An example in Zerocopy: docs.rs/zerocopy/lat...
KnownLayout in zerocopy - Rust
Indicates that zerocopy can reason about certain aspects of a type’s layout.
docs.rs
January 31, 2025 at 1:48 PM
google / zerocopy: Zerocopy makes zero-cost memory manipulation effortless. We write `unsafe` so you don’t have to. ★2472 https://github.com/google/zerocopy
google / zerocopy
Zerocopy makes zero-cost memory manipulation effortless. We write `unsafe` so you don’t have to.
github.com
July 4, 2026 at 11:55 AM
#KernelRecipes Ah... pour zerocopy ils sont obligés de mettre dans un bloc "unsafe" ?! :/
September 23, 2026 at 2:56 PM
100% agreed, and having seen the amount of care, skill, thought, and effort that is put into zerocopy, I'd 100x prefer having a zerocopy dependency over any other unsafe code.

zerocopy's unsafe code has at least 100x more than the median amount of unsafe-vetting in Rust packages.
February 4, 2025 at 2:38 PM
On Netstack.FM 🎙Ep.10: “Zerocopy Magic” with Joshua Liebow-Feeser (Google / #FuchsiaOS)
Creator of #Zerocopy & dev behind Netstack3 (400+ projects and 300M downloads).
How Rust’s type system & formal verification (Kani) enable safe “unsafe” code.
🎧Listen→ netstack.fm#episode-10
#RustLang #OpenSource
Netstack.FM — A Podcast About Networking and Rust
Interviews, monologues, and deep dives into Rust and modern networking systems.
netstack.fm
October 21, 2025 at 1:07 PM
Great article, and feature!

It's funny, in Rust when I hear zero-copy I think of safe type-punning for [de]serialization a la docs.rs/zerocopy/lat...

But here the zero-copy is more what I'd call "subslicing" or "reference projection"
zerocopy - Rust
Fast, safe, compile error. Pick two.
docs.rs
September 29, 2025 at 11:54 PM
Once again the Rust orphan rule bites me for needing to glue two types together from different crates.

In this case, `zerocopy` and `fixed` :v
June 19, 2025 at 6:30 PM
hacked up typify to also emit a zerocopy module where most of the fields are replaced with reference versions
February 21, 2025 at 2:54 AM
...and it's doubly frustrating because these folks are working against the eventual outcome they ostensibly want: the inclusion of safe transmutation APIs in the standard library. That design effort really benefits from having enthusiastic users of crates like bytemuck and zerocopy.
February 4, 2025 at 1:48 PM
I wonder if a good compromise is to make zerocopy an optional dependency for some of those crates, and fall back to transmute. That way you can check in CI that you are not doing anything dodgy via zerocopy but you don't pull it in as a dependency for your users.

bsky.app/profile/mits...
So I looked through some more reasons for why zerocopy now shows up in my dependency tree and from what I can tell it's all coming from the zerocopy developers themselves making PRs against other crates introducing the dependency. Not sure what to think of that.
February 5, 2025 at 6:41 PM
google / zerocopy: ★1288 https://github.com/google/zerocopy
google / zerocopy
github.com
September 30, 2024 at 1:26 PM
BORN TO ZEROCOPY
KERNEL IS INTERRUPT
鬼神 Route Em All 1989
I am sysadmin
410,757,864,530 PACKETS PER SECOND
June 24, 2025 at 2:43 PM
I sympathize with them. `zerocopy` is high-impact work, and it's really important to get real world experience with it before moving what we can into `core`. They've filed PRs against at least one of my projects and they were really gracious about me declining.
February 5, 2025 at 4:03 PM
I think there are misaligned incentives. For the zerocopy folks I think they want adoption and feedback, from me as a user perspective I mostly care about reducing dependencies. If unsafe can be avoided in other ways it might work for the main crate author, but it would go against zerocopy.
February 5, 2025 at 4:20 PM
This is becoming very common. I saw a couple of projects where most code was written by LLMs, the worst part is that for each bug fix, the LLM would just modify non-related things or even comment "zerocopy" where it was clearly not zerocopy.
November 23, 2025 at 12:30 AM
Yes, and I would much rather have one file with unsafe code, which is run through the best tooling standards we have, carefully audited, used in many other crates, rather than fifty different crates each with their own bespoke implementation of parts of zerocopy.
February 4, 2025 at 2:03 PM
me: yay i wuv rust >w< i wonder if i can bundle an owned buffer with a zerocopy serde struct
rust: you fool, you utter buffoon, learn what a higher-rank trait bound is or die
February 14, 2025 at 4:38 PM
thx for the recommendation, I have added zerocopy as such
March 31, 2025 at 1:43 AM