Stabilize rwlock_downgrade library feature by connortsui20 · Pull Request #143191 · rust-lang/rust (original) (raw)

Conversation

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters

[ Show hidden characters]({{ revealButtonHref }})

@connortsui20

Tracking Issue: #128203

Method to be stabilized:

impl<'a, T: ?Sized> RwLockWriteGuard<'a, T> { pub fn downgrade(s: Self) -> RwLockReadGuard<'a, T> {} }

I would like to point out that my documentation comment is longer than ideal, but at the same time I don't really know how else to show why downgrade is actually necessary (instead of just unlocking and relocking). If anyone has ideas for making this more concise that would be great! I have made the documentation a bit more clear.

Stabilization report: #128203 (comment)

@rustbot

r? @tgross35

rustbot has assigned @tgross35.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review

Status: Awaiting review from the assignee but also interested parties.

T-libs

Relevant to the library team, which will review and decide on the PR/issue.

labels

Jun 29, 2025

@Amanieu

This means that we can never go back to pthreads to back our locks, but that seems fine since the pthreads API has many issues around UB and movability.

@rfcbot merge

@rfcbot

This comment was marked as outdated.

@cuviper

This comment was marked as resolved.

@Amanieu Amanieu added T-libs-api

Relevant to the library API team, which will review and decide on the PR/issue.

and removed T-libs

Relevant to the library team, which will review and decide on the PR/issue.

labels

Jul 1, 2025

@Amanieu

This comment was marked as outdated.

@rfcbot

This comment was marked as outdated.

@Amanieu

@rfcbot

Team member @Amanieu has proposed to merge this. The next step is review by the rest of the tagged team members:

No concerns currently listed.

Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up!

See this document for info about what commands tagged team members can give me.

@connortsui20

connortsui20 added a commit to connortsui20/rust that referenced this pull request

Jul 29, 2025

@connortsui20

This commit is a purely cosmetic change to the documentation and ordering of items in the rwlock.rs file.

List of changes (lots of small things):

@bors

@rust-rfcbot

🔔 This is now entering its final comment period, as per the review above. 🔔

@rust-rfcbot

The final comment period, with a disposition to merge, as per the review above, is now complete.

As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed.

This will be merged soon.

@esote esote mentioned this pull request

Oct 11, 2025

tgross35

@tgross35

@bors

📌 Commit 780319a has been approved by tgross35

It is now in the queue for this repository.

@bors bors added the S-waiting-on-bors

Status: Waiting on bors to run and complete tests. Bors will change the label on completion.

label

Oct 15, 2025

@tgross35

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request

Oct 15, 2025

@matthiaskrgr

…grade, r=tgross35

Stabilize rwlock_downgrade library feature

Tracking Issue: rust-lang#128203

Method to be stabilized:

impl<'a, T: ?Sized> RwLockWriteGuard<'a, T> {
    pub fn downgrade(s: Self) -> RwLockReadGuard<'a, T> {}
}

I would like to point out that my documentation comment is longer than ideal, but at the same time I don't really know how else to show why downgrade is actually necessary (instead of just unlocking and relocking). If anyone has ideas for making this more concise that would be great! I have made the documentation a bit more clear.

Stabilization report: rust-lang#128203 (comment)

bors added a commit that referenced this pull request

Oct 15, 2025

@bors

Rollup of 5 pull requests

Successful merges:

r? @ghost @rustbot modify labels: rollup

bors added a commit that referenced this pull request

Oct 15, 2025

@bors

Rollup of 5 pull requests

Successful merges:

r? @ghost @rustbot modify labels: rollup

bors added a commit that referenced this pull request

Oct 15, 2025

@bors

Rollup of 11 pull requests

Successful merges:

r? @ghost @rustbot modify labels: rollup

rust-timer added a commit that referenced this pull request

Oct 16, 2025

@rust-timer

Rollup merge of #143191 - connortsui20:stabilize-rwlock-downgrade, r=tgross35

Stabilize rwlock_downgrade library feature

Tracking Issue: #128203

Method to be stabilized:

impl<'a, T: ?Sized> RwLockWriteGuard<'a, T> {
    pub fn downgrade(s: Self) -> RwLockReadGuard<'a, T> {}
}

I would like to point out that my documentation comment is longer than ideal, but at the same time I don't really know how else to show why downgrade is actually necessary (instead of just unlocking and relocking). If anyone has ideas for making this more concise that would be great! I have made the documentation a bit more clear.

Stabilization report: #128203 (comment)

github-actions bot pushed a commit to rust-lang/miri that referenced this pull request

Oct 16, 2025

@bors

flip1995 pushed a commit to flip1995/rust-clippy that referenced this pull request

Oct 18, 2025

@bors

github-actions bot pushed a commit to model-checking/verify-rust-std that referenced this pull request

Nov 30, 2025

@matthiaskrgr

…grade, r=tgross35

Stabilize rwlock_downgrade library feature

Tracking Issue: rust-lang#128203

Method to be stabilized:

impl<'a, T: ?Sized> RwLockWriteGuard<'a, T> {
    pub fn downgrade(s: Self) -> RwLockReadGuard<'a, T> {}
}

I would like to point out that my documentation comment is longer than ideal, but at the same time I don't really know how else to show why downgrade is actually necessary (instead of just unlocking and relocking). If anyone has ideas for making this more concise that would be great! I have made the documentation a bit more clear.

Stabilization report: rust-lang#128203 (comment)

github-actions bot pushed a commit to model-checking/verify-rust-std that referenced this pull request

Nov 30, 2025

@bors

…iaskrgr

Rollup of 11 pull requests

Successful merges:

r? @ghost @rustbot modify labels: rollup

Labels