Skip to content

Introduce #[diagnostic::on_move] on Rc - #154678

Merged
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
rperier:diagnostic_on_move_for_the_rc_type
Apr 8, 2026
Merged

Introduce #[diagnostic::on_move] on Rc#154678
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
rperier:diagnostic_on_move_for_the_rc_type

Conversation

@rperier

@rperierrperier commented Apr 1, 2026

Copy link
Copy Markdown
Contributor

This is related to the tracking issue #154181 and to the original issue #149862.

@rustbotrustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Apr 1, 2026
@rustbot

Copy link
Copy Markdown
Collaborator

r? @dingxiangfei2009

rustbot has assigned @dingxiangfei2009.
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: compiler
  • compiler expanded to 69 candidates
  • Random selection from 13 candidates

@rperier

Copy link
Copy Markdown
ContributorAuthor

This must be merged after #154669, probably (due to the feature gate).

r? @tgross35

@rustbot

Copy link
Copy Markdown
Collaborator

tgross35 is currently at their maximum review capacity.
They may take a while to respond.

This annotates the `Rc` type with the diagnostic attribute
`#[diagnostic::on_move]`. Now when a moved `Rc` is borrowed,
a suggestion to clone it is made, with a label explaining why.
@rperier
rperierforce-pushed the diagnostic_on_move_for_the_rc_type branch from 309fe1b to 92ed4a2CompareApril 6, 2026 18:10
@rustbot

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.

@tgross35tgross35 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@rust-bors

rust-borsBot commented Apr 7, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 92ed4a2 has been approved by tgross35

It is now in the queue for this repository.

@rust-borsrust-borsBot 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 Apr 7, 2026
@jhprattjhpratt mentioned this pull request Apr 8, 2026
rust-borsBot pushed a commit that referenced this pull request Apr 8, 2026
Rollup of 4 pull requests
Successful merges:
- #154460 (Deduplication: Pulled common logic out from lower_const_arg_struct)
- #154609 (Enable `#[diagnostic::on_const]` for local impls)
- #154678 (Introduce #[diagnostic::on_move] on `Rc`)
- #154902 (rustdoc: Inherit inline attributes for declarative macros)
@rust-bors
rust-borsBot merged commit 3be7b83 into rust-lang:mainApr 8, 2026
11 checks passed
@rustbotrustbot added this to the 1.96.0 milestone Apr 8, 2026
rust-timer added a commit that referenced this pull request Apr 8, 2026
Rollup merge of #154678 - rperier:diagnostic_on_move_for_the_rc_type, r=tgross35
Introduce #[diagnostic::on_move] on `Rc`
This is related to the tracking issue #154181 and to the original issue #149862.
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.T-libsRelevant 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.

4 participants

@rperier@rustbot@tgross35@dingxiangfei2009