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

Clarify rules about immutable statics #860

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Coder-256
Copy link

@Coder-256 Coder-256 commented Jul 28, 2020

Closes #760 since it seems to be abandoned.

@Coder-256 Coder-256 changed the title Update static-items.md Clarify rules about immutable statics Jul 28, 2020
Copy link
Contributor

@ehuss ehuss left a comment

Choose a reason for hiding this comment

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

Thanks for picking this up!

Non-`mut` static items that contain a type
that is not [interior mutable] may be placed in read-only memory.

All access to a non-`mut` static is safe, but there are a number of restrictions:
Copy link
Contributor

Choose a reason for hiding this comment

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

The rules below here seem to apply to both mut and non-mut static, right?

Note that I removed the second item in #867, as it is out-of-date.

@ehuss ehuss added the S-waiting-on-author Status: The marked PR is awaiting some action (such as code changes) from the PR author. label Aug 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-author Status: The marked PR is awaiting some action (such as code changes) from the PR author.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants