google / google/zerocopy

Support unsafely implementing trait, bypassing derive

Open
#3,465 3 comments 1 reaction 0 assignees View on GitHub
customer-request
Dominant language
Rust
Stars
2.6k
Forks
179
Avg merge
1d 19h
Merged PRs (30d)
29

Description

Rust for Linux would like to manually implement certain traits, providing a manual justification of soundness. We can't support a manual `unsafe impl` because this locks us into a forwards-compatibility guarantee that we won't add non-defaulted items to the trait. Instead, we'll need to provide an unsafe-to-call macro, a `#[derive(unsafe(zerocopy::...))]`, or some other form of indirection.

Contributor guide

Open the contributing guide

Research direction

Start by reviewing zerocopy's trait and derive support, focusing on how manual implementations and unsafe derives are currently handled. Compare the proposed unsafe-to-call macro, unsafe derive form, and other indirection options; done means a documented, maintainable mechanism that permits manual soundness justification without promising never to add non-defaulted trait items.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
backend-api-design, security
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.