Skip to content

RC module documentation concerning immutability is misleading #44105

Closed
@justintaft

Description

@justintaft

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsC-enhancementCategory: An issue proposing an enhancement or a PR with one.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions