Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Impl traits for TransparentWrapper types safely #1001

Merged
merged 1 commit into from
Mar 4, 2024

Conversation

joshlf
Copy link
Member

@joshlf joshlf commented Mar 2, 2024

TransparentWrapper provides enough safety guarantees that, for some traits, it can be used as a bound to implement those traits without needing extra safety logic.

This commit introduces the impl_for_transparent_wrapper! macro, which emits the appropriate bound on TransparentWrapper in order to justify the soundness of a given trait impl internally, thus not requiring the caller to provide a safety proof.

@joshlf joshlf force-pushed the transparent-wrapper-trait-impls branch 3 times, most recently from 12b26e6 to 699046b Compare March 2, 2024 23:24
@joshlf joshlf marked this pull request as ready for review March 2, 2024 23:24
@joshlf joshlf requested a review from jswrenn March 2, 2024 23:24
`TransparentWrapper` provides enough safety guarantees that, for some
traits, it can be used as a bound to implement those traits without
needing extra safety logic.

This commit introduces the `impl_for_transparent_wrapper!` macro, which
emits the appropriate bound on `TransparentWrapper` in order to justify
the soundness of a given trait impl internally, thus not requiring the
caller to provide a safety proof.
@joshlf joshlf force-pushed the transparent-wrapper-trait-impls branch from 699046b to 5c026a0 Compare March 3, 2024 20:52
@joshlf joshlf added this pull request to the merge queue Mar 4, 2024
Merged via the queue into main with commit 7653f37 Mar 4, 2024
210 checks passed
@joshlf joshlf deleted the transparent-wrapper-trait-impls branch March 4, 2024 04:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants