Skip to content

Remove T: Send + Sync bound from Arc::downcast - #161531

Merged
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
maxdexh:arc-downcast-no-sync-send
Nov 27, 2026
Merged

rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
maxdexh:arc-downcast-no-sync-send

Conversation

@maxdexh

@maxdexh maxdexh commented Aug 22, 2026 •

Copy link
Copy Markdown
Member

Discussion on zulip

Implements the change described in rust-lang/libs-team#859.
T-libs can pick if they want to skip the ACP or not.

@rustbot label needs-fcp T-libs

@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 Aug 22, 2026
@rustbot

rustbot commented Aug 22, 2026

Copy link
Copy Markdown
Collaborator

r? @Mark-Simulacrum

rustbot has assigned @Mark-Simulacrum.
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 JohnTitor, Mark-Simulacrum, clarfonthey, nia-e

@rustbot rustbot added the needs-fcp This change is insta-stable, or significant enough to need a team FCP to proceed. label Aug 22, 2026
@Mark-Simulacrum

Copy link
Copy Markdown
Member
 impl<A: Allocator> Arc<dyn Any + Send + Sync, A> {
 // stable diff
-    fn downcast<T: Any + Send + Sync>(self) -> Result<Arc<T, A>, Arc<dyn Any + Send + Sync, A>>;
+    fn downcast<T: Any>(self) -> Result<Arc<T, A>, Arc<dyn Any + Send + Sync, A>>;
 // unstable diff
-    fn downcast_unchecked<T: Any + Send + Sync>(self) -> Arc<T, A>;
+    fn downcast_unchecked<T: Any>(self) -> Arc<T, A>;
 }

@rfcbot fcp merge libs

I think this bound is probably further relaxable to T: 'static + ?Sized, but if we do that it can be follow-up across all of the downcast APIs on Box/Arc/Rc.

@rust-rfcbot

rust-rfcbot commented Aug 22, 2026 •

Copy link
Copy Markdown
Collaborator

@Mark-Simulacrum 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. and removed needs-fcp This change is insta-stable, or significant enough to need a team FCP to proceed. labels Aug 22, 2026
@Mark-Simulacrum Mark-Simulacrum added S-waiting-on-fcp Status: PR is in FCP and is awaiting for FCP to complete. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 22, 2026
@maxdexh

maxdexh commented Aug 22, 2026 •

Copy link
Copy Markdown
Member Author

I think this bound is probably further relaxable to T: 'static + ?Sized, but if we do that it can be follow-up across all of the downcast APIs on Box/Arc/Rc.

Do you mean by returning Err for all unsized types? Ah I see, you'd also relax the bound on is. Yeah that should work

@rust-bors

This comment has been minimized.

@maxdexh
maxdexh force-pushed the arc-downcast-no-sync-send branch from 8de72e6 to ddfcd93 Compare September 30, 2026 18:26
@clarfonthey

Copy link
Copy Markdown
Contributor

cc @joshtriplett @the8472 if either of you is okay checking your box here for this relatively simple change.

@rust-rfcbot rust-rfcbot added final-comment-period In the final comment period and will be merged soon unless new substantive objections are raised. and removed proposed-final-comment-period Proposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off. labels Nov 17, 2026
@rust-rfcbot

Copy link
Copy Markdown
Collaborator

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

@rust-rfcbot rust-rfcbot added finished-final-comment-period The final comment period is finished for this PR / Issue. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. to-announce Announce this issue on triage meeting and removed final-comment-period In the final comment period and will be merged soon unless new substantive objections are raised. S-waiting-on-fcp Status: PR is in FCP and is awaiting for FCP to complete. labels Nov 27, 2026
@rust-rfcbot

Copy link
Copy Markdown
Collaborator

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.

@clarfonthey

Copy link
Copy Markdown
Contributor

r? me
@bors r+ rollup

@rust-bors

rust-bors Bot commented Nov 27, 2026

Copy link
Copy Markdown
Contributor

📌 Commit ddfcd93 has been approved by clarfonthey

It is now in the queue for this repository.

@rust-bors rust-bors Bot 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 27, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Nov 27, 2026
rust-bors Bot pushed a commit that referenced this pull request Nov 27, 2026
…uwer

Rollup of 9 pull requests

Successful merges:

 - #163895 (Stabilize `--remap-path-scope` in rustdoc and the `documentation` scope)
 - #163910 (debugger: stabilize trim-paths unremap file loading)
 - #166175 (Use `__fastfail()` for `crash()` on Windows)
 - #166377 (fix: ignore format literal source availability in stable hashes)
 - #166510 (add c-variadic support for `x87_f80`)
 - #166650 (Don't round the number of bits passed to `{Size,Align}::from_bits`)
 - #161531 (Remove `T: Send + Sync` bound from `Arc::downcast`)
 - #166641 (fix: bootstrap build directory handling with --set)
 - #166655 (Submodule update of rustc-perf)
rust-bors Bot pushed a commit that referenced this pull request Nov 27, 2026
…uwer

Rollup of 9 pull requests

Successful merges:

 - #163895 (Stabilize `--remap-path-scope` in rustdoc and the `documentation` scope)
 - #163910 (debugger: stabilize trim-paths unremap file loading)
 - #166377 (fix: ignore format literal source availability in stable hashes)
 - #166510 (add c-variadic support for `x87_f80`)
 - #166631 (Remove `fn terminator()` and `terminator_mut()`)
 - #166650 (Don't round the number of bits passed to `{Size,Align}::from_bits`)
 - #161531 (Remove `T: Send + Sync` bound from `Arc::downcast`)
 - #166641 (fix: bootstrap build directory handling with --set)
 - #166655 (Submodule update of rustc-perf)
@rust-bors
rust-bors Bot merged commit a4d20f5 into rust-lang:main Nov 27, 2026
13 checks passed
@rustbot rustbot added this to the 1.102.0 milestone Nov 27, 2026
rust-bors Bot pushed a commit that referenced this pull request Nov 27, 2026
Rollup merge of #161531 - maxdexh:arc-downcast-no-sync-send, r=clarfonthey

Remove `T: Send + Sync` bound from `Arc::downcast`

[Discussion](https://rust-lang.zulipchat.com/#narrow/channel/219381-t-libs/topic/Why.20the.20.60T.3A.20Send.20.2B.20Sync.60.20bound.20in.20.60Arc.3A.3Adowncast.60.3F/with/617793925) on zulip

Implements the change described in rust-lang/libs-team#859.
T-libs can pick if they want to skip the ACP or not.

@rustbot label needs-fcp T-libs
mehmettoplu-rs pushed a commit to mehmettoplu-rs/miri that referenced this pull request Nov 28, 2026
…uwer

Rollup of 9 pull requests

Successful merges:

 - rust-lang/rust#163895 (Stabilize `--remap-path-scope` in rustdoc and the `documentation` scope)
 - rust-lang/rust#163910 (debugger: stabilize trim-paths unremap file loading)
 - rust-lang/rust#166377 (fix: ignore format literal source availability in stable hashes)
 - rust-lang/rust#166510 (add c-variadic support for `x87_f80`)
 - rust-lang/rust#166631 (Remove `fn terminator()` and `terminator_mut()`)
 - rust-lang/rust#166650 (Don't round the number of bits passed to `{Size,Align}::from_bits`)
 - rust-lang/rust#161531 (Remove `T: Send + Sync` bound from `Arc::downcast`)
 - rust-lang/rust#166641 (fix: bootstrap build directory handling with --set)
 - rust-lang/rust#166655 (Submodule update of rustc-perf)
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. finished-final-comment-period The final comment period is finished for this PR / Issue. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs Relevant to the library team, which will review and decide on the PR/issue. to-announce Announce this issue on triage meeting

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants