Skip to content

Rollup of 3 pull requests - #166579

Closed
clarfonthey wants to merge 8 commits into
rust-lang:mainfrom
clarfonthey:rollup-DUEHezu
Closed

clarfonthey wants to merge 8 commits into
rust-lang:mainfrom
clarfonthey:rollup-DUEHezu

Conversation

@clarfonthey

Copy link
Copy Markdown
Contributor

Successful merges:

r? @ghost

Create a similar rollup

SleighPenguin22 and others added 8 commits November 25, 2026 14:18
When no field of a `Reborrow` type is reborrowed, borrowck borrows the
whole source value instead. That fallback assumed the target type has
exactly one lifetime and hit a `bug!` otherwise, even though `Reborrow`
impls on types with several lifetimes are accepted.

Borrow the source under each of the target's lifetimes instead. The one
lifetime case is unchanged, and the source stays borrowed for as long as
any of the target's lifetimes is live.
…e_no_reborrowed_field, r=Dnreikronos

borrowck: Fix Reborrow ICE on types with several lifetimes

Fixes rust-lang#165653

The ICE comes from borrowck. When a Reborrow type has no field that actually gets reborrowed (no `&mut` and no other Reborrow type inside), borrowck borrows the whole value instead, and that code just assumed the type has one lifetime. Reborrow types can have more than one lifetime now, so something like the struct with `&'a &'b str` from the issue blew up right there.

The fix is in that fallback. When nothing gets reborrowed, borrowck now borrows the whole value once for each lifetime of the target type instead of panicking. With one lifetime it does exactly what it did before. With more it keeps the value borrowed while any of them is still alive, so two live reborrows of a two lifetime marker still get the usual "borrowed as mutable more than once" error, and using them one after the other is fine, same as with one lifetime. The program from the issue now gets the same error its one lifetime version already gets, since it's reborrowing through a shared ref.

I ran a bunch of programs against a recent nightly. Nothing that compiles there stops compiling, the crashes are gone (generic fields, associated type fields, fields that are only Copy in some functions, CoerceShared targets with more lifetimes than the source all hit the same spot), and the ones that error now get the same error as their one lifetime version. Two things I didn't touch are the `&'static mut` field ICE (rust-lang#164933) and a CoerceShared panic when the source and target PhantomData fields don't match, that one also happens with one lifetime so it's a different bug.

Honestly I think borrowing under every lifetime is the safe choice but maybe not the smartest one, a smarter version could work out which lifetime really matters for each field. If someone who knows the Reborrow design better has an opinion on that I'm happy to change it.
…args, r=ZuseZ4

autodiff: don't ICE on invalid macro arguments

Fixes rust-lang#150326
Fixes rust-lang#150327
Fixes rust-lang#150329
Fixes rust-lang#160329

The generated function name must now be a single identifier. Activities that aren't identifiers get the existing "did not recognize Activity" error. A function with a return type but no activities gets the existing activity count error, and expansion stops there.

In rust-lang#160329, parser recovery leaves the function with more parameters than activities. That case now stops at the count error, so its crash test moves to `tests/ui/autodiff`.
…xed-slice, r=clarfonthey

remove `Box::into_boxed_slice`

This removes the implementation of `Box::into_boxed_slice` as discussed in https://github.com/issues/recent?issue=rust-lang%7Crust%7C71582&issue_global_id=MDU6SXNzdWU2MDcwMDMxNzc%3D
@rust-bors rust-bors Bot added the rollup A PR which is a rollup label Nov 26, 2026
@rustbot rustbot added A-box Area: Our favorite opsem complication 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 Nov 26, 2026
@clarfonthey

Copy link
Copy Markdown
Contributor Author

@bors r+ p=5 force

Trying commonly failed jobs
@bors try jobs=dist-various-1,dist-various-2,test-various,test-x86_64-gnu-aux,test-x86_64-msvc-1,test-aarch64-apple-1,test-aarch64-apple-2,test-x86_64-mingw-1,test-i686-msvc,test-armhf-gnu,test-x86_64-gnu-llvm-22-3,test-aarch64-msvc-2

@rust-bors

rust-bors Bot commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 2ab3146 has been approved by clarfonthey

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 Nov 26, 2026
rust-bors Bot pushed a commit that referenced this pull request Nov 26, 2026
Rollup of 3 pull requests


try-job: dist-various-1
try-job: dist-various-2
try-job: test-various
try-job: test-x86_64-gnu-aux
try-job: test-x86_64-msvc-1
try-job: test-aarch64-apple-1
try-job: test-aarch64-apple-2
try-job: test-x86_64-mingw-1
try-job: test-i686-msvc
try-job: test-armhf-gnu
try-job: test-x86_64-gnu-llvm-22-3
try-job: test-aarch64-msvc-2
@rust-bors

This comment has been minimized.

@clarfonthey

Copy link
Copy Markdown
Contributor Author

Adding another PR to rollup.

@rust-bors rust-bors Bot 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-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Nov 26, 2026
@rust-bors

rust-bors Bot commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

This pull request was unapproved due to being closed.

@clarfonthey
clarfonthey deleted the rollup-DUEHezu branch November 26, 2026 02:53
@rust-bors

rust-bors Bot commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: 6e863d7 (6e863d7cc06253b41fcbcf8942887193c2babd23)
Base parent: 6c709eb (6c709eb428d472a3c3d93681c1ba37d44a1c27cf)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-box Area: Our favorite opsem complication rollup A PR which is a rollup S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. 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.

5 participants