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

Implement TransparentWrapper for UnsafeCell #1025

Merged
merged 2 commits into from
Mar 6, 2024

Conversation

joshlf
Copy link
Member

@joshlf joshlf commented Mar 6, 2024

This allows us to replace unsafe implementations of core traits with
safe ones, using the TransparentWrapper bound to prove safety via the
impl_for_transparent_wrapper! macro.

This will allow us to implement `TransparentWrapper` for `T` where `T`
and `T::Inner` do not have `UnsafeCell`s at the same byte ranges. This,
in turn, will let us automatically implement traits for these types so
long as those traits don't require reasoning about `UnsafeCell` ranges
(in other words, all traits other than `NoCell`).
This allows us to replace unsafe implementations of core traits with
safe ones, using the `TransparentWrapper` bound to prove safety via the
`impl_for_transparent_wrapper!` macro.
@joshlf joshlf requested a review from jswrenn March 6, 2024 15:24
@joshlf joshlf changed the base branch from main to unsafe-cell-variance March 6, 2024 15:25
@joshlf joshlf changed the title Unsafe cell transparent wrapper Implement TransparentWrapper for UnsafeCell Mar 6, 2024
@joshlf joshlf changed the title Implement TransparentWrapper for UnsafeCell Implement TransparentWrapper for UnsafeCell Mar 6, 2024
Base automatically changed from unsafe-cell-variance to main March 6, 2024 15:51
@joshlf joshlf added this pull request to the merge queue Mar 6, 2024
Merged via the queue into main with commit 7e65049 Mar 6, 2024
210 checks passed
@joshlf joshlf deleted the unsafe-cell-transparent-wrapper branch March 6, 2024 16:00
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