Skip to content

Add CoerceShared field-wise reborrow WF checks - #157489

Merged
rust-bors[bot] merged 3 commits into
rust-lang:mainfrom
P8L1:split/coerceshared-wf-check
Aug 6, 2026
Merged

Add CoerceShared field-wise reborrow WF checks#157489
rust-bors[bot] merged 3 commits into
rust-lang:mainfrom
P8L1:split/coerceshared-wf-check

Conversation

@P8L1

@P8L1 P8L1 commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

View all comments

This PR attempts to add a well-formedness check for CoerceShared.
Split out of #157101

r? @aapoalas

@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. labels Jun 5, 2026
@P8L1

P8L1 commented Jun 5, 2026

Copy link
Copy Markdown
Contributor Author

@rustbot label +F-Reborrow

@rustbot rustbot added the F-reborrow `#![feature(reborrow)]`; see #145612 label Jun 5, 2026

@aapoalas aapoalas left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Some issues but overall this looks pretty promising.

I'd kind of like the tests to all rather be added in the #157490 and then this PR to show which ones it fixes and which ones remain issues, but I'm not too partial on that point. I've reviewed the PR in the conventional comments style, so anything marked "thought" or "note" is just musings and not something you need to necessarily react to (unless you wish to), "question" is me being unsure but not something that would block the PR from merging, and "issues" and anything else marked "blocking" must be addressed before this can be considered for merging.

I'm also somewhat surprised that this PR didn't actually change any of the existing test results... I guess that's just a sign of our existing ui feature tests being insufficient :D

View changes since this review

Comment thread compiler/rustc_hir_analysis/src/coherence/builtin.rs Outdated
Comment thread compiler/rustc_hir_analysis/src/coherence/builtin.rs Outdated
Comment thread compiler/rustc_hir_analysis/src/coherence/builtin.rs Outdated
Comment thread compiler/rustc_hir_analysis/src/coherence/builtin.rs Outdated
Comment thread compiler/rustc_hir_analysis/src/coherence/builtin.rs Outdated
Comment thread tests/ui/reborrow/coerce-shared-field-lifetime-swap.rs Outdated
Comment thread tests/ui/reborrow/auxiliary/reborrow_foreign_private.rs Outdated
Comment thread tests/ui/reborrow/coerce-shared-foreign-private-tuple-field.rs Outdated
Comment thread tests/ui/reborrow/coerce-shared-lifetime-mismatch.stderr
Comment thread tests/ui/reborrow/marker-coerce-shared-corrected-issue-156309.rs Outdated
@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 Jun 5, 2026
@rustbot

rustbot commented Jun 5, 2026

Copy link
Copy Markdown
Collaborator

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

@P8L1

P8L1 commented Jun 8, 2026

Copy link
Copy Markdown
Contributor Author

@rustbot ready

@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 Jun 8, 2026
@P8L1
P8L1 requested a review from aapoalas June 8, 2026 14:27

@aapoalas aapoalas left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Two issues remain from my point of view. I'll pass this for compiler reviewers next :)

View changes since this review

@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 Jun 11, 2026
@P8L1
P8L1 force-pushed the split/coerceshared-wf-check branch from c82f18a to 8a5f5aa Compare June 12, 2026 11:04
@P8L1
P8L1 requested a review from aapoalas June 12, 2026 11:19
@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 Jun 12, 2026
@P8L1

P8L1 commented Jun 12, 2026

Copy link
Copy Markdown
Contributor Author

@rustbot ready

@rust-bors

This comment has been minimized.

@P8L1

P8L1 commented Jun 14, 2026

Copy link
Copy Markdown
Contributor Author

I will be rebasing this Wednesday I think, and I will also update it so it shows what tests it fixes

@P8L1
P8L1 force-pushed the split/coerceshared-wf-check branch from 46b362c to d5e890a Compare June 15, 2026 09:25
@rustbot

This comment has been minimized.

@P8L1

P8L1 commented Jun 15, 2026

Copy link
Copy Markdown
Contributor Author

Ok, I had some time sooner than I expected I would. @aapoalas, I think I'm ready for another review.

@aapoalas

Copy link
Copy Markdown
Contributor

r? @oli-obk

@rustbot rustbot assigned oli-obk and unassigned aapoalas Jun 15, 2026
@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 Jul 9, 2026
@P8L1
P8L1 requested a review from oli-obk July 9, 2026 23:15

@oli-obk oli-obk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

One more nit, lgtm now.

Please squash the commits appropriately. I'm fine with one big one, but if you have sth more fine grained that wfm

View changes since this review

Comment thread compiler/rustc_hir_analysis/src/coherence/builtin/coerce_shared.rs
@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 Jul 10, 2026
@P8L1
P8L1 force-pushed the split/coerceshared-wf-check branch from ee0fb99 to 1300328 Compare July 10, 2026 20:55
@rust-log-analyzer

This comment has been minimized.

P8L1 added 3 commits July 10, 2026 23:41
@P8L1
P8L1 force-pushed the split/coerceshared-wf-check branch from 1300328 to ec4384c Compare July 10, 2026 22:08
@rustbot

rustbot commented Jul 10, 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.

@P8L1

P8L1 commented Jul 10, 2026

Copy link
Copy Markdown
Contributor Author

@rustbot ready

@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 Jul 10, 2026
@P8L1
P8L1 requested a review from oli-obk July 10, 2026 22:44
@P8L1

P8L1 commented Jul 22, 2026

Copy link
Copy Markdown
Contributor Author

@oli-obk Hi, I'm sorry to ping you, but could you please take a look at this when you get the chance. It has been about 2 weeks.

@oli-obk

oli-obk commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

I kept seeing it on my review queue. I'm sorry, I should have reviewed it immediately.

@bors r+ rollup

@rust-bors

rust-bors Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

📌 Commit ec4384c has been approved by oli-obk

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 Aug 5, 2026
@P8L1

P8L1 commented Aug 5, 2026

Copy link
Copy Markdown
Contributor Author

I kept seeing it on my review queue. I'm sorry, I should have reviewed it immediately.

@bors r+ rollup

It's fine, I'm sure you have more than enough on your plate already.

Thanks so much for your review!

rust-bors Bot pushed a commit that referenced this pull request Aug 5, 2026
…uwer

Rollup of 12 pull requests

Successful merges:

 - #159014 ([rustdoc] Do not take `doc(cfg())` into account when filtering doctests)
 - #159029 (rustc_llvm: Emit module summaries when using -Clto=fat)
 - #160574 (Update rustc-perf submodule)
 - #154585 (treat no_mangle_generic_items as hard error instead of lint warning)
 - #159473 (Fix, simplify, and document doc meta finalize mode)
 - #157489 (Add CoerceShared field-wise reborrow WF checks)
 - #160532 (Add Enzyme bugfix to support rust+llvm23)
 - #160545 (Reorder the methods in `#[rustc_must_implement_one_of]`)
 - #160558 (Revert "codegen_ssa: no dbginfo for scalable vec local w/ `-O0`")
 - #160566 (Re-enable bool indexing assembly test for LLVM 23)
 - #160569 (Remove `OnDuplicate::Custom`)
 - #160576 ([rustdoc] Create output file after we checked that the standalone markdown file is valid)
@rust-bors
rust-bors Bot merged commit 7dbc6af into rust-lang:main Aug 6, 2026
13 checks passed
@rustbot rustbot added this to the 1.99.0 milestone Aug 6, 2026
rust-timer added a commit that referenced this pull request Aug 6, 2026
Rollup merge of #157489 - P8L1:split/coerceshared-wf-check, r=oli-obk

Add CoerceShared field-wise reborrow WF checks

This PR attempts to add a well-formedness check for CoerceShared.
Split out of #157101

r? @aapoalas
github-actions Bot pushed a commit to rust-lang/stdarch that referenced this pull request Aug 6, 2026
…uwer

Rollup of 12 pull requests

Successful merges:

 - rust-lang/rust#159014 ([rustdoc] Do not take `doc(cfg())` into account when filtering doctests)
 - rust-lang/rust#159029 (rustc_llvm: Emit module summaries when using -Clto=fat)
 - rust-lang/rust#160574 (Update rustc-perf submodule)
 - rust-lang/rust#154585 (treat no_mangle_generic_items as hard error instead of lint warning)
 - rust-lang/rust#159473 (Fix, simplify, and document doc meta finalize mode)
 - rust-lang/rust#157489 (Add CoerceShared field-wise reborrow WF checks)
 - rust-lang/rust#160532 (Add Enzyme bugfix to support rust+llvm23)
 - rust-lang/rust#160545 (Reorder the methods in `#[rustc_must_implement_one_of]`)
 - rust-lang/rust#160558 (Revert "codegen_ssa: no dbginfo for scalable vec local w/ `-O0`")
 - rust-lang/rust#160566 (Re-enable bool indexing assembly test for LLVM 23)
 - rust-lang/rust#160569 (Remove `OnDuplicate::Custom`)
 - rust-lang/rust#160576 ([rustdoc] Create output file after we checked that the standalone markdown file is valid)
pull Bot pushed a commit to LeeeeeeM/miri that referenced this pull request Aug 6, 2026
…uwer

Rollup of 12 pull requests

Successful merges:

 - rust-lang/rust#159014 ([rustdoc] Do not take `doc(cfg())` into account when filtering doctests)
 - rust-lang/rust#159029 (rustc_llvm: Emit module summaries when using -Clto=fat)
 - rust-lang/rust#160574 (Update rustc-perf submodule)
 - rust-lang/rust#154585 (treat no_mangle_generic_items as hard error instead of lint warning)
 - rust-lang/rust#159473 (Fix, simplify, and document doc meta finalize mode)
 - rust-lang/rust#157489 (Add CoerceShared field-wise reborrow WF checks)
 - rust-lang/rust#160532 (Add Enzyme bugfix to support rust+llvm23)
 - rust-lang/rust#160545 (Reorder the methods in `#[rustc_must_implement_one_of]`)
 - rust-lang/rust#160558 (Revert "codegen_ssa: no dbginfo for scalable vec local w/ `-O0`")
 - rust-lang/rust#160566 (Re-enable bool indexing assembly test for LLVM 23)
 - rust-lang/rust#160569 (Remove `OnDuplicate::Custom`)
 - rust-lang/rust#160576 ([rustdoc] Create output file after we checked that the standalone markdown file is valid)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

F-reborrow `#![feature(reborrow)]`; see #145612 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants