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

doc: clarify Mutex::try_lock, etc. errors #85529

Merged
merged 2 commits into from
May 26, 2021
Merged

Conversation

tlyu
Copy link
Contributor

@tlyu tlyu commented May 20, 2021

Clarify error returns from Mutex::try_lock, RwLock::try_read,
RwLock::try_write to make it more obvious that both poisoning
and the lock being already locked are possible errors.

Clarify error returns from Mutex::try_lock, RwLock::try_read,
RwLock::try_write to make it more obvious that both poisoning
and the lock being already locked are possible errors.
@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 @Mark-Simulacrum (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.

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 20, 2021
Copy link
Member

@JohnTitor JohnTitor left a comment

Choose a reason for hiding this comment

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

Overall LGTM with one nit.

library/std/src/sync/mutex.rs Outdated Show resolved Hide resolved
library/std/src/sync/rwlock.rs Outdated Show resolved Hide resolved
library/std/src/sync/rwlock.rs Outdated Show resolved Hide resolved
library/std/src/sync/rwlock.rs Outdated Show resolved Hide resolved
library/std/src/sync/rwlock.rs Outdated Show resolved Hide resolved
Use "the `WouldBlock` error" instead of "the error `WouldBlock`", etc.
@tlyu
Copy link
Contributor Author

tlyu commented May 24, 2021

Thanks for the review! I've pushed an update.

@JohnTitor
Copy link
Member

Thanks! @bors r+ rollup

@bors
Copy link
Contributor

bors commented May 25, 2021

📌 Commit 0e4f8cb has been approved by JohnTitor

@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 May 25, 2021
JohnTitor added a commit to JohnTitor/rust that referenced this pull request May 25, 2021
doc: clarify Mutex::try_lock, etc. errors

Clarify error returns from Mutex::try_lock, RwLock::try_read,
RwLock::try_write to make it more obvious that both poisoning
and the lock being already locked are possible errors.
JohnTitor added a commit to JohnTitor/rust that referenced this pull request May 26, 2021
doc: clarify Mutex::try_lock, etc. errors

Clarify error returns from Mutex::try_lock, RwLock::try_read,
RwLock::try_write to make it more obvious that both poisoning
and the lock being already locked are possible errors.
bors added a commit to rust-lang-ci/rust that referenced this pull request May 26, 2021
Rollup of 12 pull requests

Successful merges:

 - rust-lang#84048 (Avoid CJK legacy fonts in Windows)
 - rust-lang#85529 (doc: clarify Mutex::try_lock, etc. errors)
 - rust-lang#85590 (Fix bootstrap using host exe suffix for cargo)
 - rust-lang#85610 (Fix pointer provenance in <[T]>::copy_within)
 - rust-lang#85623 (Remove stray .stderr files)
 - rust-lang#85645 (Demote `ControlFlow::{from|into}_try` to `pub(crate)`)
 - rust-lang#85647 (Revert "Move llvm submodule updates to rustbuild")
 - rust-lang#85666 (Document shared_from_cow functions)
 - rust-lang#85668 (Fix tasklist example in rustdoc book.)
 - rust-lang#85672 (Move stability attribute for items under the `ip` feature)
 - rust-lang#85699 (Update books)
 - rust-lang#85701 (Update cargo)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit ae6a1a7 into rust-lang:master May 26, 2021
@rustbot rustbot added this to the 1.54.0 milestone May 26, 2021
@tlyu tlyu deleted the trylock-errors branch June 8, 2021 04:46
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.

None yet

6 participants