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

Restate Immutable's guarantees #1165

Merged
merged 1 commit into from
May 2, 2024
Merged

Restate Immutable's guarantees #1165

merged 1 commit into from
May 2, 2024

Conversation

jswrenn
Copy link
Collaborator

@jswrenn jswrenn commented May 2, 2024

This PR adjust's Immutable's informal public contract. Previously, we publicly documented that Immutable denoted that a type does not directly contain UnsafeCell. Now, we only document that Immutable types do not permit interrior mutation.

This change is made in recognition that:

  • Containing UnsafeCell may be fine, so long as that the special properties of that UnsafeCell cannot be exercised in safe code.
  • In contrast to what's guaranteed by the compiler's Freeze trait, we almost certainly need recursive immutability for safe transmutation.

Makes progress towards #1155.

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
src/lib.rs Outdated Show resolved Hide resolved
This PR adjust's `Immutable`'s informal public contract. Previously, we publicly
documented that `Immutable` denoted that a type does not directly contain
`UnsafeCell`. Now, we only document that `Immutable` types do not permit
interrior mutation.

This change is made in recognition that:
 - Containing `UnsafeCell` may be fine, so long as that the special properties
   of that `UnsafeCell` cannot be exercised in safe code.
 - In contrast to what's guaranteed by the compiler's `Freeze` trait, we almost
   certainly need *recursive* immutability for safe transmutation.

Makes progress towards #1155.
@jswrenn jswrenn requested a review from joshlf May 2, 2024 19:43
@jswrenn jswrenn enabled auto-merge May 2, 2024 19:44
@jswrenn jswrenn added this pull request to the merge queue May 2, 2024
Merged via the queue into main with commit 0fc6df9 May 2, 2024
210 checks passed
@jswrenn jswrenn deleted the change-immutable branch May 2, 2024 20:02
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.

2 participants