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

In std:rc, clarify the lack of mutability inside an Rc #39299

Merged
merged 1 commit into from
Feb 3, 2017
Merged

In std:rc, clarify the lack of mutability inside an Rc #39299

merged 1 commit into from
Feb 3, 2017

Conversation

federicomenaquintero
Copy link
Contributor

Also, point to the example in Cell's docs for how to do it.

@rust-highfive
Copy link
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @BurntSushi (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

Copy link
Member

@GuillaumeGomez GuillaumeGomez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Few nits.

//! [`RefCell`].
//! Shared references in Rust disallow mutation by default, and `Rc`
//! is no exception: you cannot obtain a mutable reference to
//! something inside an `Rc`. If you need mutability, put a [`Cell`]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra whitespace before "if you need mutability".

//! Shared references in Rust disallow mutation by default, and `Rc` is no
//! exception. If you need to mutate through an [`Rc`], use [`Cell`] or
//! [`RefCell`].
//! Shared references in Rust disallow mutation by default, and `Rc`
Copy link
Member

@GuillaumeGomez GuillaumeGomez Jan 31, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

`Rc` should be [`Rc`].

//! [`RefCell`].
//! Shared references in Rust disallow mutation by default, and `Rc`
//! is no exception: you cannot obtain a mutable reference to
//! something inside an `Rc`. If you need mutability, put a [`Cell`]
Copy link
Member

@GuillaumeGomez GuillaumeGomez Jan 31, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

`Rc` should be [`Rc`].

@GuillaumeGomez
Copy link
Member

Just a few nits and it'll be good!

@federicomenaquintero
Copy link
Contributor Author

Pushed an extra commit to de-nitify.

@@ -214,6 +216,7 @@
//! [upgrade]: struct.Weak.html#method.upgrade
//! [`None`]: ../../std/option/enum.Option.html#variant.None
//! [assoc]: ../../book/method-syntax.html#associated-functions
//! [introducing-mutability]: ../../std/cell/index.html#introducing-mutability-inside-of-something-immutable
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line is longer than 100 characters so tidy fails.

@GuillaumeGomez
Copy link
Member

Once your tidy issue has been fixed, please squash your commits.

Also, point to the example in Cell's docs for how to do it.
@federicomenaquintero
Copy link
Contributor Author

I've pushed a squashed version. This also has a shortened link name so the line in the references doesn't exceed 100 chars :-P

@GuillaumeGomez
Copy link
Member

Thanks!

@bors: r+ rollup

@bors
Copy link
Contributor

bors commented Feb 1, 2017

📌 Commit 4a07e72 has been approved by GuillaumeGomez

GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Feb 2, 2017
…laumeGomez

In std:rc, clarify the lack of mutability inside an Rc

Also, point to the example in Cell's docs for how to do it.
bors added a commit that referenced this pull request Feb 2, 2017
Rollup of 9 pull requests

- Successful merges: #38823, #39196, #39299, #39319, #39373, #39383, #39416, #39420, #39427
- Failed merges:
@bors bors merged commit 4a07e72 into rust-lang:master Feb 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants