Skip to content

mention Arc::make_mut alongside Mutex #138322

Closed
@lolbinarycat

Description

@lolbinarycat

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.

Metadata

Metadata

Assignees

Labels

A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsneeds-triageThis issue may need triage. Remove it if it has been sufficiently triaged.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions