Skip to content

Clarify rules about immutable statics - #860

Open
jacob-greenfield wants to merge 1 commit into
rust-lang:masterfrom
jacob-greenfield:patch-1
Open

Clarify rules about immutable statics#860
jacob-greenfield wants to merge 1 commit into
rust-lang:masterfrom
jacob-greenfield:patch-1

Conversation

@jacob-greenfield

@jacob-greenfieldjacob-greenfield commented Jul 28, 2020

Copy link
Copy Markdown

Closes#760 since it seems to be abandoned.

@jacob-greenfieldjacob-greenfield changed the title Update static-items.mdClarify rules about immutable staticsJul 28, 2020

@ehussehuss left a comment

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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.

@ehussehuss 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
@rustbot

Copy link
Copy Markdown
Collaborator

☔ The latest upstream changes (possibly bf115a4) made this pull request unmergeable. Please resolve the merge conflicts.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-authorStatus: 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.

3 participants

@jacob-greenfield@rustbot@ehuss