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

[TryFromBytes] Permit UnsafeCells #890

Merged
merged 1 commit into from
Feb 17, 2024
Merged

[TryFromBytes] Permit UnsafeCells #890

merged 1 commit into from
Feb 17, 2024

Conversation

jswrenn
Copy link
Collaborator

@jswrenn jswrenn commented Feb 16, 2024

No description provided.

@joshlf joshlf force-pushed the unsafecell-reform branch 3 times, most recently from 049610a to a31e1c7 Compare February 17, 2024 03:06
@joshlf joshlf changed the title [wip] UnsafeCell reform [TryFromBytes] Permit UnsafeCells Feb 17, 2024
@joshlf joshlf force-pushed the unsafecell-reform branch 3 times, most recently from 797bac0 to 4b388b5 Compare February 17, 2024 16:20
@joshlf joshlf marked this pull request as ready for review February 17, 2024 16:20
@joshlf joshlf self-requested a review February 17, 2024 16:20
Copy link
Member

@joshlf joshlf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to make sure that all call sites have new safety proofs that mention UnsafeCell for:

  • Ptr::project
  • Ptr::cast_unsized

src/lib.rs Outdated Show resolved Hide resolved
src/lib.rs Outdated Show resolved Hide resolved
src/lib.rs Outdated Show resolved Hide resolved
src/lib.rs Show resolved Hide resolved
Previously, `TryFromBytes` could not be implemented on types which
contain `UnsafeCell`s. This commit lifts that restriction, and replaces
it with a `NoCell` bound on the `try_from_ref` method.
@jswrenn jswrenn added this pull request to the merge queue Feb 17, 2024
Merged via the queue into main with commit 5df1f79 Feb 17, 2024
209 checks passed
@jswrenn jswrenn deleted the unsafecell-reform branch February 17, 2024 18:00
@joshlf
Copy link
Member

joshlf commented Feb 17, 2024

Closes #873

dorryspears pushed a commit to dorryspears/zerocopy that referenced this pull request Feb 20, 2024
Previously, `TryFromBytes` could not be implemented on types which
contain `UnsafeCell`s. This commit lifts that restriction, and replaces
it with a `NoCell` bound on the `try_from_ref` method.
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