You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsT-libsRelevant to the library team, which will review and decide on the PR/issue.
The prose here mentions how Arc does not provide interior mutability, but in many cases you don't actually need shared interior mutability, just the ability to effeciently mutate something that happens to be in an Arc.
Seeing how many people who are new to rust gravitate towards Arc<Mutex<T>> to avoid dealing with references, it would probably be good to mention copy-on-write semantics as an alternative.
The text was updated successfully, but these errors were encountered:
lolbinarycat
added
the
A-docs
Area: Documentation for any part of the project, including the compiler, standard library, and tools
label
Mar 10, 2025
std: Mention clone-on-write mutation in Arc<T>
Fixesrust-lang#138322
r? libs
jieyouxu
added
T-libs
Relevant to the library team, which will review and decide on the PR/issue.
and removed
needs-triage
This issue may need triage. Remove it if it has been sufficiently triaged.
labels
Mar 26, 2025
A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsT-libsRelevant to the library team, which will review and decide on the PR/issue.
Location
https://doc.rust-lang.org/stable/std/sync/struct.Arc.html
Summary
The prose here mentions how Arc does not provide interior mutability, but in many cases you don't actually need shared interior mutability, just the ability to effeciently mutate something that happens to be in an
Arc
.Seeing how many people who are new to rust gravitate towards
Arc<Mutex<T>>
to avoid dealing with references, it would probably be good to mention copy-on-write semantics as an alternative.The text was updated successfully, but these errors were encountered: