Skip to content

Commit

Permalink
Clarify wording of the Sync requirement for an immutable static
Browse files Browse the repository at this point in the history
Additionally, this drops the statement that all access is "safe" since
there isn't anything that would imply that it is unsafe.
  • Loading branch information
ehuss committed Oct 9, 2024
1 parent 68fb8b8 commit 73de72e
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/items/static-items.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ Static initializers may refer to other statics.
Non-`mut` static items that contain a type that is not [interior mutable] may
be placed in read-only memory.

All access to a static is safe,
provided that the type must have the `Sync` trait bound to allow thread-safe access.
The type of an immutable static must implement the [`Sync`](std::marker::Sync) trait.

The initializer expression must be omitted in an [external block], and must be
provided for free static items.
Expand Down

0 comments on commit 73de72e

Please sign in to comment.