google / google/zerocopy

Implement `KnownLayout` for all `T: Sized`

Open
#1,920 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
2.6k
Forks
179
Avg merge
1d 19h
Merged PRs (30d)
29

Description

This is currently impossible because it causes impl conflicts with any generic `#[derive(KnownLayout)]`. However, if we could get Rust to understand that we're only emitting a derive for unsized types, it'd be possible. Prototyped in https://github.com/google/zerocopy/commit/5601ac4821528dfa72548d324d2a2a329459cfb8, but Rust doesn't know that `TrailingField: KnownLayout` implies `TrailingField: !Sized`. Maybe we can spell `TrailingField: !Sized` somehow?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.