Support derives on more types by allowing user to specify concrete types
Open
- Dominant language
- Rust
- Stars
- 2.6k
- Forks
- 179
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 29
Description
*Credit to @kupiakos for this idea*
Our derives are not able to support all generic types. However, sometimes a user may not need a given trait to be implemented for every instantiation of type variables. In this case, we could permit them to specify concrete types for which they want zerocopy trait impls:
```rust
#[derive(IntoBytes)]
#[zerocopy(derive_for = Foo)]
#[repr(C)]
struct Foo(A, B);
// Emitted by derive:
unsafe impl IntoBytes for Foo { ... }
```
Contributor guide
Assessment
This issue has not been assessed yet.