Skip to content

stabilize {Rc, Arc}::is_unique - #163458

Open
malezjaa wants to merge 1 commit into
rust-lang:mainfrom
malezjaa:stabilize-arc-is_unique
Open

malezjaa wants to merge 1 commit into
rust-lang:mainfrom
malezjaa:stabilize-arc-is_unique

Conversation

@malezjaa

@malezjaa malezjaa commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Stabilization report:

Closes #138938

{Arc,Rc}::is_unique, is a function that allows determining whether there is exactly one strong count and zero weak counts to an Arc/Rc.

Implementation history

Implementation: #138939

Public api

// alloc::rc
impl<T> Rc<T> {
    pub fn is_unique(this: &Self) -> bool;
}

// alloc::sync
impl<T> Arc<T> {
    pub fn is_unique(this: &Self) -> bool;
}

@rustbot modify labels: +T-libs

This is a pretty small feature, so opening this to hopefully get a FCP started.

@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 Sep 28, 2026
@rustbot

rustbot commented Sep 28, 2026

Copy link
Copy Markdown
Collaborator

r? @JohnTitor

rustbot has assigned @JohnTitor.
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

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: libs
  • libs expanded to 12 candidates
  • Random selection from 6 candidates

@malezjaa

Copy link
Copy Markdown
Contributor Author

r? libs

@rustbot rustbot assigned clarfonthey and unassigned JohnTitor Sep 28, 2026
@clarfonthey

Copy link
Copy Markdown
Contributor

It was already assigned to libs, but, sure.

Is there a reason why this API isn't offered on Rc too? That seems like an important detail to determine before stabilisation.

@malezjaa

malezjaa commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor Author

I don't think there was any. The ACP only proposed it for Arc, and Rc::is_unique was proposed by @tgross35 in the tracking issue, but never really implemented.

I can add it, but I'm not sure if it belongs in this PR.

@clarfonthey

Copy link
Copy Markdown
Contributor

I mean, I don't like the precedent of stabilising asymmetric impls on Arc that could go on Rc too, which is maybe a sign we dont want to stabilise this yet.

@malezjaa

Copy link
Copy Markdown
Contributor Author

I assume that Rc variant should be on its own tracking issue and ACP?

@clarfonthey

Copy link
Copy Markdown
Contributor

I would say that unless there's significant reason to make things different on Arc and Rc then new features should apply to both. We don't want to stabilise separately.

@rust-bors

This comment has been minimized.

@clarfonthey

Copy link
Copy Markdown
Contributor

Once #163489 merges and this is rebased on top of that, I think it's okay to FCP merge, since Rc's functionality already existed, just wasn't public. If you could update the PR description also, that would help.

Thank you!

@clarfonthey

Copy link
Copy Markdown
Contributor

@rustbot author

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 30, 2026
@rustbot

rustbot commented Sep 30, 2026

Copy link
Copy Markdown
Collaborator

Reminder, once the PR becomes ready for a review, use @rustbot ready.

@malezjaa
malezjaa force-pushed the stabilize-arc-is_unique branch from eae707b to 89f1208 Compare October 1, 2026 14:14
@rustbot

rustbot commented Oct 1, 2026

Copy link
Copy Markdown
Collaborator

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@malezjaa malezjaa changed the title stabilize Arc::is_unique stabilize {Rc, Arc}::is_unique Oct 1, 2026
@malezjaa

malezjaa commented Oct 1, 2026

Copy link
Copy Markdown
Contributor Author

@rustbot ready

Rebased and updated :D

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Oct 1, 2026
@clarfonthey

Copy link
Copy Markdown
Contributor

@rfcbot merge libs

@rust-rfcbot

rust-rfcbot commented Oct 1, 2026 •

Copy link
Copy Markdown
Collaborator

@clarfonthey 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!

cc @rust-lang/libs-ping: FCP proposed for libs, please feel free to register concerns.
See this document for info about what commands tagged team members can give me.

@rust-rfcbot rust-rfcbot added proposed-final-comment-period Proposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off. disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it. labels Oct 1, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it. proposed-final-comment-period Proposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off. 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tracking Issue for arc_is_unique

5 participants