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

RC module documentation concerning immutability is misleading #44105

Closed
justintaft opened this issue Aug 26, 2017 · 0 comments
Closed

RC module documentation concerning immutability is misleading #44105

justintaft opened this issue Aug 26, 2017 · 0 comments
Labels
A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools C-enhancement Category: An issue proposing an enhancement or a PR with one.

Comments

@justintaft
Copy link

justintaft commented Aug 26, 2017

RC module documentation should clarify mutable references can be obtained, under certain conditions.

Rc module documentation sates:
"Shared references in Rust disallow mutation by default, and Rc is no exception: you cannot obtain a mutable reference to something inside an Rc."

https://doc.rust-lang.org/std/rc/

Rc's get_mut method states:
"Returns a mutable reference to the inner value, if there are no other Rc or Weak pointers to the same value.".

https://doc.rust-lang.org/std/rc/struct.Rc.html#method.get_mut

@justintaft justintaft changed the title [doc] RC module immutability documentation misleading [doc] RC module documentation concerning immutability is misleading Aug 26, 2017
@QuietMisdreavus QuietMisdreavus added the A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools label Aug 26, 2017
@Mark-Simulacrum Mark-Simulacrum added the C-enhancement Category: An issue proposing an enhancement or a PR with one. label Aug 26, 2017
@steveklabnik steveklabnik changed the title [doc] RC module documentation concerning immutability is misleading RC module documentation concerning immutability is misleading Oct 5, 2017
steveklabnik added a commit to steveklabnik/rust that referenced this issue Oct 5, 2017
There are a few exceptions to the rule that Arc/Rc are immutable. Rather
than dig into the details, add "generally" to hint at this difference,
as it's kind of a distraction at this point in the docs.

Additionally, Arc's docs were slightly different here generally, so add
in both the existing language and the exception.

Fixes rust-lang#44105
kennytm added a commit to kennytm/rust that referenced this issue Oct 8, 2017
Modify Rc/Arc language around mutability

There are a few exceptions to the rule that Arc/Rc are immutable. Rather
than dig into the details, add "generally" to hint at this difference,
as it's kind of a distraction at this point in the docs.

Additionally, Arc's docs were slightly different here generally, so add
in both the existing language and the exception.

Fixes rust-lang#44105
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools C-enhancement Category: An issue proposing an enhancement or a PR with one.
Projects
None yet
Development

No branches or pull requests

3 participants