On Sun, Sep 27, 2026 at 02:08:36AM +0200, Miguel Ojeda wrote:
> On Sun, Sep 27, 2026 at 1:49 AM Gary Guo <[email protected]> wrote:
> >
> > I think the skip-on-error default was added in a version newer than what 
> > we've
> > vendored.
> 
> I was going to update, so that shouldn't be a big problem.
> 

The skip_on_error() method is available in the kernel’s vendored copy of 
zerocopy-derive
v0.8.54 and it doesn’t change in the latest version so I don’t think that 
updating to
0.8.59 would help us here if that's what you mean?

The problem is that skip_on_error() has a small scope; it only skips errors when
generating the implementation blocks for these traits. (For example if it’s a 
binding
for an unsupported representation type.) Otherwise, zerocopy-derive will 
generate impl
blocks with trait bound requirements (e.g. on struct fields) which only fail 
later at
compile-time type checking.

For example, when I tried deriving most_traits for all of the generated structs 
I got
about 300 compile errors due to unions inside structs that did not implement 
KnownLayout
When I derived most_traits for unions as well, I got an error that deriving 
IntoBytes
for unions needs a special cfg to enable because its soundness is still under 
discussion.
  error: requires --cfg zerocopy_derive_union_into_bytes;
  please let us know you use this feature: 
https://github.com/google/zerocopy/discussions/1802

Also, I get about 200 compile errors complaining that KnownLayout can’t 
currently be
implemented for bindgen’s incomplete array field helper.

So I do think it’s reasonable to implement these traits using zerocopy-derive 
on a
case-by-case basis.

> Cheers,
> Miguel

Reply via email to