The Wayback Machine - https://web.archive.org/web/20201228170752/https://github.com/rust-lang/reference/pull/860
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
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
@Coder-256 Coder-256 force-pushed the Coder-256:patch-1 branch from a2b38e8 to 2d6b851 Jul 29, 2020
Copy link
Collaborator

@ehuss ehuss left a comment

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:

This comment has been minimized.

@ehuss

ehuss Aug 3, 2020
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.