Skip to content

Introduce #[diagnostic::on_move] on Arc#154669

Open
rperier wants to merge 1 commit intorust-lang:mainfrom
rperier:diagnostic_on_move_for_the_arc_type
Open

Introduce #[diagnostic::on_move] on Arc#154669
rperier wants to merge 1 commit intorust-lang:mainfrom
rperier:diagnostic_on_move_for_the_arc_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? @TaKO8Ki

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

cc @tgross35

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.

One nit, r=me either way

View changes since this review

@tgross35 tgross35 assigned tgross35 and unassigned TaKO8Ki Apr 1, 2026
This annotates the `Arc` type with the diagnostic attribute
`#[diagnostic::on_move]`. Now when a moved `Arc` is borrowed,
a suggestion to clone it is made, with a label explaining why.
@rperier rperier force-pushed the diagnostic_on_move_for_the_arc_type branch from d4ccfcc to 12f8364 Compare April 1, 2026 09:01
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 1, 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.

@rperier
Copy link
Copy Markdown
Contributor Author

rperier commented Apr 1, 2026

Rebased onto main and fixed the label message

@tgross35
Copy link
Copy Markdown
Contributor

tgross35 commented Apr 1, 2026

@bors r+

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors bot commented Apr 1, 2026

📌 Commit 12f8364 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 1, 2026
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Apr 1, 2026
…_arc_type, r=tgross35

Introduce #[diagnostic::on_move] on `Arc`

This is related to the tracking issue rust-lang#154181 and to the original issue rust-lang#149862 .
rust-bors bot pushed a commit that referenced this pull request Apr 1, 2026
Rollup of 7 pull requests

Successful merges:

 - #153105 (Compute the result of a projection type with region errors)
 - #153960 (Make `layout_of` cycles fatal errors)
 - #154666 (Remove `StableHashContext` impls)
 - #154669 (Introduce #[diagnostic::on_move] on `Arc`)
 - #154442 (Export `derive` at the crate root: `core::derive` and `std::derive`)
 - #154660 (Avoid creating async return opaques for foreign async fns)
 - #154680 ([rustdoc] Replace `DocContext` with `TyCtxt` wherever possible)
jhpratt added a commit to jhpratt/rust that referenced this pull request Apr 2, 2026
…_arc_type, r=tgross35

Introduce #[diagnostic::on_move] on `Arc`

This is related to the tracking issue rust-lang#154181 and to the original issue rust-lang#149862 .
rust-bors bot pushed a commit that referenced this pull request Apr 2, 2026
Rollup of 11 pull requests

Successful merges:

 - #153105 (Compute the result of a projection type with region errors)
 - #153286 (various fixes for scalable vectors)
 - #153960 (Make `layout_of` cycles fatal errors)
 - #154527 (Emit pre-expansion feature gate warnings for negative impls and specialization)
 - #154666 (Remove `StableHashContext` impls)
 - #154669 (Introduce #[diagnostic::on_move] on `Arc`)
 - #154442 (Export `derive` at the crate root: `core::derive` and `std::derive`)
 - #154644 (rustdoc: seperate methods and associated functions in sidebar)
 - #154660 (Avoid creating async return opaques for foreign async fns)
 - #154671 (Add a test for a past ICE when calling a const fn of an unresolved type with the wrong number of args)
 - #154680 ([rustdoc] Replace `DocContext` with `TyCtxt` wherever possible)
jhpratt added a commit to jhpratt/rust that referenced this pull request Apr 2, 2026
…_arc_type, r=tgross35

Introduce #[diagnostic::on_move] on `Arc`

This is related to the tracking issue rust-lang#154181 and to the original issue rust-lang#149862 .
rust-bors bot pushed a commit that referenced this pull request Apr 2, 2026
Rollup of 11 pull requests

Successful merges:

 - #153105 (Compute the result of a projection type with region errors)
 - #153960 (Make `layout_of` cycles fatal errors)
 - #154527 (Emit pre-expansion feature gate warnings for negative impls and specialization)
 - #154666 (Remove `StableHashContext` impls)
 - #154669 (Introduce #[diagnostic::on_move] on `Arc`)
 - #154213 (tidy-alphabetical: fix line number in error message)
 - #154442 (Export `derive` at the crate root: `core::derive` and `std::derive`)
 - #154644 (rustdoc: seperate methods and associated functions in sidebar)
 - #154660 (Avoid creating async return opaques for foreign async fns)
 - #154671 (Add a test for a past ICE when calling a const fn of an unresolved type with the wrong number of args)
 - #154680 ([rustdoc] Replace `DocContext` with `TyCtxt` wherever possible)
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Apr 2, 2026
…_arc_type, r=tgross35

Introduce #[diagnostic::on_move] on `Arc`

This is related to the tracking issue rust-lang#154181 and to the original issue rust-lang#149862 .
rust-bors bot pushed a commit that referenced this pull request Apr 2, 2026
…uwer

Rollup of 21 pull requests

Successful merges:

 - #153105 (Compute the result of a projection type with region errors)
 - #153286 (various fixes for scalable vectors)
 - #153532 (Attributes containing rustc)
 - #153960 (Make `layout_of` cycles fatal errors)
 - #154527 (Emit pre-expansion feature gate warnings for negative impls and specialization)
 - #154666 (Remove `StableHashContext` impls)
 - #154669 (Introduce #[diagnostic::on_move] on `Arc`)
 - #154710 (opaque_generic_const_args -> generic_const_args)
 - #154712 (Revert "`-Znext-solver` Remove the forced ambiguity hack from search graph")
 - #154713 (Stop compiling when we get resolving crate failure)
 - #154213 (tidy-alphabetical: fix line number in error message)
 - #154425 (Migrate transmute tests)
 - #154442 (Export `derive` at the crate root: `core::derive` and `std::derive`)
 - #154469 (mGCA: Lower spans for literal const args)
 - #154578 (Rename `probe_ty_var` to `try_resolve_ty_var`)
 - #154615 (Moving issues)
 - #154644 (rustdoc: seperate methods and associated functions in sidebar)
 - #154660 (Avoid creating async return opaques for foreign async fns)
 - #154671 (Add a test for a past ICE when calling a const fn of an unresolved type with the wrong number of args)
 - #154680 ([rustdoc] Replace `DocContext` with `TyCtxt` wherever possible)
 - #154709 (Revert `Ty` type alias in `rustc_type_ir`)
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Apr 2, 2026
…_arc_type, r=tgross35

Introduce #[diagnostic::on_move] on `Arc`

This is related to the tracking issue rust-lang#154181 and to the original issue rust-lang#149862 .
rust-bors bot pushed a commit that referenced this pull request Apr 2, 2026
…uwer

Rollup of 21 pull requests

Successful merges:

 - #153105 (Compute the result of a projection type with region errors)
 - #153286 (various fixes for scalable vectors)
 - #153532 (Attributes containing rustc)
 - #153960 (Make `layout_of` cycles fatal errors)
 - #154527 (Emit pre-expansion feature gate warnings for negative impls and specialization)
 - #154666 (Remove `StableHashContext` impls)
 - #154669 (Introduce #[diagnostic::on_move] on `Arc`)
 - #154710 (opaque_generic_const_args -> generic_const_args)
 - #154712 (Revert "`-Znext-solver` Remove the forced ambiguity hack from search graph")
 - #153614 (`FindParamInClause` handle edge-cases)
 - #154213 (tidy-alphabetical: fix line number in error message)
 - #154425 (Migrate transmute tests)
 - #154442 (Export `derive` at the crate root: `core::derive` and `std::derive`)
 - #154469 (mGCA: Lower spans for literal const args)
 - #154578 (Rename `probe_ty_var` to `try_resolve_ty_var`)
 - #154615 (Moving issues)
 - #154644 (rustdoc: seperate methods and associated functions in sidebar)
 - #154660 (Avoid creating async return opaques for foreign async fns)
 - #154671 (Add a test for a past ICE when calling a const fn of an unresolved type with the wrong number of args)
 - #154680 ([rustdoc] Replace `DocContext` with `TyCtxt` wherever possible)
 - #154709 (Revert `Ty` type alias in `rustc_type_ir`)
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Apr 2, 2026
…_arc_type, r=tgross35

Introduce #[diagnostic::on_move] on `Arc`

This is related to the tracking issue rust-lang#154181 and to the original issue rust-lang#149862 .
rust-bors bot pushed a commit that referenced this pull request Apr 2, 2026
…uwer

Rollup of 20 pull requests

Successful merges:

 - #153105 (Compute the result of a projection type with region errors)
 - #153532 (Attributes containing rustc)
 - #153960 (Make `layout_of` cycles fatal errors)
 - #154527 (Emit pre-expansion feature gate warnings for negative impls and specialization)
 - #154666 (Remove `StableHashContext` impls)
 - #154669 (Introduce #[diagnostic::on_move] on `Arc`)
 - #154710 (opaque_generic_const_args -> generic_const_args)
 - #154712 (Revert "`-Znext-solver` Remove the forced ambiguity hack from search graph")
 - #153614 (`FindParamInClause` handle edge-cases)
 - #154213 (tidy-alphabetical: fix line number in error message)
 - #154425 (Migrate transmute tests)
 - #154442 (Export `derive` at the crate root: `core::derive` and `std::derive`)
 - #154469 (mGCA: Lower spans for literal const args)
 - #154578 (Rename `probe_ty_var` to `try_resolve_ty_var`)
 - #154615 (Moving issues)
 - #154644 (rustdoc: seperate methods and associated functions in sidebar)
 - #154660 (Avoid creating async return opaques for foreign async fns)
 - #154671 (Add a test for a past ICE when calling a const fn of an unresolved type with the wrong number of args)
 - #154680 ([rustdoc] Replace `DocContext` with `TyCtxt` wherever possible)
 - #154709 (Revert `Ty` type alias in `rustc_type_ir`)
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