Skip to content

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

Merged
rust-bors[bot] merged 1 commit intorust-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 intorust-lang:mainfrom
rperier:diagnostic_on_move_for_the_rc_type

Conversation

@rperier
Copy link
Copy Markdown
Contributor

@rperier rperier commented Apr 1, 2026

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

@rustbot rustbot 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

rustbot commented Apr 1, 2026

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
Contributor Author

rperier commented Apr 1, 2026

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

r? @tgross35

@rustbot rustbot assigned tgross35 and unassigned dingxiangfei2009 Apr 1, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 1, 2026

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 rperier force-pushed the diagnostic_on_move_for_the_rc_type branch from 309fe1b to 92ed4a2 Compare April 6, 2026 18:10
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 6, 2026

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.

Copy link
Copy Markdown
Contributor

@tgross35 tgross35 left a comment

Choose a reason for hiding this comment

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

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors bot commented Apr 7, 2026

📌 Commit 92ed4a2 has been approved by tgross35

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 Apr 7, 2026
rust-bors bot 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-bors bot merged commit 3be7b83 into rust-lang:main Apr 8, 2026
11 checks passed
@rustbot rustbot 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 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. 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants