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

Slight copy-editing for std::cell::Cell docs #55377

Merged
merged 1 commit into from
Nov 7, 2018
Merged

Conversation

goffrie
Copy link
Contributor

@goffrie goffrie commented Oct 26, 2018

Hopefully this is a bit more precise and also more correct English.

@rust-highfive
Copy link
Collaborator

r? @joshtriplett

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 26, 2018
/// // my_struct.regular_field = new_value;
///
/// // WORKS, although `my_struct` is immutable, field `special_field` is mutable because it is Cell
Copy link
Member

Choose a reason for hiding this comment

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

Here, the old version is clearer because it explicitly says "is mutable because". (Cleaning up the grammar would be helpful, though.)

@@ -225,10 +225,10 @@ use ptr;
///
/// let new_value = 100;
///
/// // ERROR, because my_struct is immutable
/// // ERROR: my_struct is immutable
Copy link
Member

Choose a reason for hiding this comment

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

I don't think this is clearer.

/// Here you can see how using `Cell<T>` allows to use mutable field inside
/// immutable struct (which is also called 'interior mutability').
/// In this example, you can see that `Cell<T>` enables mutation inside an
/// immutable struct. In other words, it enables interior mutability.
Copy link
Member

Choose a reason for hiding this comment

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

This seems like an improvement, except that you should still keep the explicit quoting on 'interior mutability' to make it clear that it defines this new term.

Hopefully this is a bit more precise and also more correct English.
@TimNN
Copy link
Contributor

TimNN commented Nov 6, 2018

Ping from triage @joshtriplett: It looks like this PR is ready for your review again.

@joshtriplett
Copy link
Member

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Nov 6, 2018

📌 Commit 6df57a7 has been approved by joshtriplett

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 6, 2018
kennytm added a commit to kennytm/rust that referenced this pull request Nov 7, 2018
Slight copy-editing for `std::cell::Cell` docs

Hopefully this is a bit more precise and also more correct English.
bors added a commit that referenced this pull request Nov 7, 2018
Rollup of 14 pull requests

Successful merges:

 - #55377 (Slight copy-editing for `std::cell::Cell` docs)
 - #55441 (Remove unused re import in gdb_rust_pretty_printing)
 - #55453 (Choose predicates without inference variables over those with them)
 - #55495 (Don't print opt fuel messages to stdout because it breaks Rustbuild)
 - #55501 (Make `process_obligations`' computation of `completed` optional.)
 - #55510 (Fix feature gate only being checked on first repr attr.)
 - #55609 (Run name-anon-globals after LTO passes as well)
 - #55645 (do not print wrapping ranges like normal ranges in validity diagnostics)
 - #55688 (Standardised names and location of ui issue tests)
 - #55692 (-C remark: fix incorrect warning about requiring "--debuginfo" instead of "-C debuginfo=n")
 - #55702 (Add `aarch64-pc-windows-msvc` to deployed targets)
 - #55728 (Update lldb)
 - #55730 (Use trait impl method span when type param mismatch is due to impl Trait)
 - #55734 (refactor: use shorthand fields)
@bors bors merged commit 6df57a7 into rust-lang:master Nov 7, 2018
alexreg pushed a commit to alexreg/rust that referenced this pull request Nov 7, 2018
Rollup of 14 pull requests

Successful merges:

 - rust-lang#55377 (Slight copy-editing for `std::cell::Cell` docs)
 - rust-lang#55441 (Remove unused re import in gdb_rust_pretty_printing)
 - rust-lang#55453 (Choose predicates without inference variables over those with them)
 - rust-lang#55495 (Don't print opt fuel messages to stdout because it breaks Rustbuild)
 - rust-lang#55501 (Make `process_obligations`' computation of `completed` optional.)
 - rust-lang#55510 (Fix feature gate only being checked on first repr attr.)
 - rust-lang#55609 (Run name-anon-globals after LTO passes as well)
 - rust-lang#55645 (do not print wrapping ranges like normal ranges in validity diagnostics)
 - rust-lang#55688 (Standardised names and location of ui issue tests)
 - rust-lang#55692 (-C remark: fix incorrect warning about requiring "--debuginfo" instead of "-C debuginfo=n")
 - rust-lang#55702 (Add `aarch64-pc-windows-msvc` to deployed targets)
 - rust-lang#55728 (Update lldb)
 - rust-lang#55730 (Use trait impl method span when type param mismatch is due to impl Trait)
 - rust-lang#55734 (refactor: use shorthand fields)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants