Open cbarrick opened 8 months ago
In general, I don't really work on the proc-macros parts of the crate myself, so I don't know for sure, but https://github.com/Lokathor/bytemuck/blob/main/derive/src/traits.rs#L259 seems to be the code that decides what the wrapped type is when an argument is given. At a glance, it looks like the code will only pull one token from the stream iterator (which is assumed to be the type's ident), so it won't work with any types that use a generic (which looks like name < t >
, four tokens).
This is not by design, it should work with generics, and I'd be happy to accept a PR that fixes this situation.
It appears that the derive macro for
TransparentWrapper
does not work with types likeBox
orOption
.I'm not sure if this is a bug or a feature request.
Minimal repro:
Expected reslut:
Foo: TransparentWrapper<Box<usize>>
Actual result: