Skip to content

Add regression tests for #156380 - #164888

Merged
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
yashaggarwal85d:fix-156380-reborrow-test
Oct 26, 2026
Merged

rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
yashaggarwal85d:fix-156380-reborrow-test

Conversation

@yashaggarwal85d

@yashaggarwal85d yashaggarwal85d commented Oct 25, 2026 •

Copy link
Copy Markdown

Adds two ui tests in tests/ui/reborrow for the two snippets in #156380.

The first one (moving a String out of a Reborrow type twice) was fixed by #156784. That PR has its own test but with a different struct, so this adds the exact repro from the issue.

The second one (getting two aliasing &mut i32 through a generic field) had no test. It compiles on nightly-2026-08-28 and errors on nightly-2026-08-29, which points at #159103.

I checked both by hand: they compile on nightly-2026-05-20 and error on the current nightly, with and without -Znext-solver.

Fixes #156380

Disclaimer - AI was used to explore and get the understanding of the codebase. All the changes and tests are executed and reviewed by me personally. Thansk

@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 Oct 25, 2026
@rustbot

rustbot commented Oct 25, 2026

Copy link
Copy Markdown
Collaborator

Thanks for the pull request, and welcome! The Rust Project has assigned @nnethercote (or someone else) to review your changes, you should hear from them (or someone else) within the next two weeks.

Please see the contribution instructions and our LLM policy for more information.

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: compiler
  • compiler expanded to 77 candidates
  • Random selection from 18 candidates

@rustbot

This comment has been minimized.

@yashaggarwal85d
yashaggarwal85d force-pushed the fix-156380-reborrow-test branch from 8090098 to 178c4e1 Compare October 25, 2026 07:26
@nnethercote

Copy link
Copy Markdown
Contributor

@bors r+ rollup

@rust-bors

rust-bors Bot commented Oct 26, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 178c4e1 has been approved by nnethercote

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 Oct 26, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Oct 26, 2026
…w-test, r=nnethercote

Add regression tests for rust-lang#156380

Adds two ui tests in `tests/ui/reborrow` for the two snippets in rust-lang#156380.

The first one (moving a `String` out of a `Reborrow` type twice) was fixed by rust-lang#156784. That PR has its own test but with a different struct, so this adds the exact repro from the issue.

The second one (getting two aliasing `&mut i32` through a generic field) had no test. It compiles on nightly-2026-08-28 and errors on nightly-2026-08-29, which points at rust-lang#159103.

I checked both by hand: they compile on nightly-2026-05-20 and error on the current nightly, with and without `-Znext-solver`.

Fixes rust-lang#156380

Disclaimer - AI was used to explore and get the understanding of the codebase. All the changes and tests are executed and reviewed by me personally. Thansk
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Oct 26, 2026
…w-test, r=nnethercote

Add regression tests for rust-lang#156380

Adds two ui tests in `tests/ui/reborrow` for the two snippets in rust-lang#156380.

The first one (moving a `String` out of a `Reborrow` type twice) was fixed by rust-lang#156784. That PR has its own test but with a different struct, so this adds the exact repro from the issue.

The second one (getting two aliasing `&mut i32` through a generic field) had no test. It compiles on nightly-2026-08-28 and errors on nightly-2026-08-29, which points at rust-lang#159103.

I checked both by hand: they compile on nightly-2026-05-20 and error on the current nightly, with and without `-Znext-solver`.

Fixes rust-lang#156380

Disclaimer - AI was used to explore and get the understanding of the codebase. All the changes and tests are executed and reviewed by me personally. Thansk
rust-bors Bot pushed a commit that referenced this pull request Oct 26, 2026
…uwer

Rollup of 12 pull requests

Successful merges:

 - #162808 (Enable `--generate-link-to-definition` rustdoc option on std docs)
 - #163219 (assumptions_on_binders: Test mixed ambiguous ORs)
 - #164985 (Only recover if we may for `recover_missing_dot`)
 - #161521 (Replace check_attr_crate_level with check_target for #[doc])
 - #162530 (Move #[naked] attribute check to attribute parsing stage)
 - #164103 (trait solver: Resolve region vars before eager placeholder handling)
 - #164692 (move `ppcf128` lang item to `core::num::imp`)
 - #164702 (Point at `impl` through which associated function is provided)
 - #164776 (Account for trait object with implicit `'static` lifetime in field type being returned)
 - #164791 (Self param after const param)
 - #164856 (Switch from `insta` to `expect-test` in bootstrap)
 - #164888 (Add regression tests for #156380)
rust-bors Bot pushed a commit that referenced this pull request Oct 26, 2026
…uwer

Rollup of 14 pull requests

Successful merges:

 - #163219 (assumptions_on_binders: Test mixed ambiguous ORs)
 - #164985 (Only recover if we may for `recover_missing_dot`)
 - #161521 (Replace check_attr_crate_level with check_target for #[doc])
 - #162530 (Move #[naked] attribute check to attribute parsing stage)
 - #164103 (trait solver: Resolve region vars before eager placeholder handling)
 - #164692 (move `ppcf128` lang item to `core::num::imp`)
 - #164702 (Point at `impl` through which associated function is provided)
 - #164741 (Use explicit target cpu in tests parsing generated asm)
 - #164767 (Add regression tests for transmutability issues)
 - #164776 (Account for trait object with implicit `'static` lifetime in field type being returned)
 - #164791 (Self param after const param)
 - #164856 (Switch from `insta` to `expect-test` in bootstrap)
 - #164888 (Add regression tests for #156380)
 - #164967 (Add codegen test for power of two implying nonzero with debuginfo)
@rust-bors
rust-bors Bot merged commit b298069 into rust-lang:main Oct 26, 2026
14 checks passed
@rustbot rustbot added this to the 1.101.0 milestone Oct 26, 2026
rust-bors Bot pushed a commit that referenced this pull request Oct 26, 2026
Rollup merge of #164888 - yashaggarwal85d:fix-156380-reborrow-test, r=nnethercote

Add regression tests for #156380

Adds two ui tests in `tests/ui/reborrow` for the two snippets in #156380.

The first one (moving a `String` out of a `Reborrow` type twice) was fixed by #156784. That PR has its own test but with a different struct, so this adds the exact repro from the issue.

The second one (getting two aliasing `&mut i32` through a generic field) had no test. It compiles on nightly-2026-08-28 and errors on nightly-2026-08-29, which points at #159103.

I checked both by hand: they compile on nightly-2026-05-20 and error on the current nightly, with and without `-Znext-solver`.

Fixes #156380

Disclaimer - AI was used to explore and get the understanding of the codebase. All the changes and tests are executed and reviewed by me personally. Thansk
github-actions Bot pushed a commit to rust-lang/stdarch that referenced this pull request Oct 26, 2026
…uwer

Rollup of 14 pull requests

Successful merges:

 - rust-lang/rust#163219 (assumptions_on_binders: Test mixed ambiguous ORs)
 - rust-lang/rust#164985 (Only recover if we may for `recover_missing_dot`)
 - rust-lang/rust#161521 (Replace check_attr_crate_level with check_target for #[doc])
 - rust-lang/rust#162530 (Move #[naked] attribute check to attribute parsing stage)
 - rust-lang/rust#164103 (trait solver: Resolve region vars before eager placeholder handling)
 - rust-lang/rust#164692 (move `ppcf128` lang item to `core::num::imp`)
 - rust-lang/rust#164702 (Point at `impl` through which associated function is provided)
 - rust-lang/rust#164741 (Use explicit target cpu in tests parsing generated asm)
 - rust-lang/rust#164767 (Add regression tests for transmutability issues)
 - rust-lang/rust#164776 (Account for trait object with implicit `'static` lifetime in field type being returned)
 - rust-lang/rust#164791 (Self param after const param)
 - rust-lang/rust#164856 (Switch from `insta` to `expect-test` in bootstrap)
 - rust-lang/rust#164888 (Add regression tests for #156380)
 - rust-lang/rust#164967 (Add codegen test for power of two implying nonzero with debuginfo)
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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Reborrow unsoundness due to not checking for Copy

3 participants