Skip to content

Rollup of 5 pull requests - #160899

Merged
rust-bors[bot] merged 14 commits into
rust-lang:mainfrom
JonathanBrouwer:rollup-Rrm4Q6k
Aug 11, 2026
Merged

Rollup of 5 pull requests#160899
rust-bors[bot] merged 14 commits into
rust-lang:mainfrom
JonathanBrouwer:rollup-Rrm4Q6k

Conversation

@JonathanBrouwer

Copy link
Copy Markdown
Contributor

Successful merges:

r? @ghost

Create a similar rollup

Albab-Hasan and others added 14 commits July 24, 2026 19:34
when a closure literal is passed as a function argument and E0271 fires
for a projection that isnt FnOnceOutput, the error now points at the
closures return expression and labels the closure declaration with
"this closure", mirroring the existing FnOnce handling in
maybe_detailed_projection_msg, which cant recover the closure from
self_ty alone.

fixes rust-lang#42390
On Windows, the UTF-16 to UTF-8 translation is made simpler by ensuring we don't split code points.:
…d filled in the buffer when reallocation occurs
This intermediate commit helps to preserve line history.
If there is non-trivial code in `main.rs`, then any items it touches need to be
publicly exported from the library crate. Those public exports make it harder
to identify unused code within bootstrap.
There is no need to re-export anything, so all `pub use` imports can be
simplified to `use` and merged with their siblings.
…, r=oli-obk

Implement derives for Reborrow and CoerceShared

This adds built-in derive support for the experimental `Reborrow` and `CoerceShared` marker traits behind `#![feature(reborrow)]`.

The derives generate the same marker impls users would write manually, while preserving the existing coherence and structural validation path for the experimental reborrow traits.

## Please note this impl:

- Preserves generics, lifetimes, const params, and where clauses in generated impls.
- Preserves multiple lifetime parameters in generated impls instead of duplicating the current experimental one-lifetime limitation in the derive layer.
- Requires an explicit `CoerceShared` target type through the derive helper attribute.
- Adds UI coverage for valid derives, feature gating, malformed helper attributes, unsupported item kinds, validation failures, and multiple-lifetime derive behavior.
- Makes the derive layer future-proof for multiple lifetimes: it preserves all lifetime parameters and generates the same impl shape as a manual impl.

@rustbot label F-reborrow
Tracking: rust-lang#145612
…_init, r=Darksonn

Fix perf regression in `Read::read_to_end` on short reads due to not checking if the cursor has initialized bytes

This PR fixes rust-lang#158008.

In particular, in rust-lang#150129, it refactored some code within `library/std/io/mod.rs` to utilize `BorrowedBuf::is_init` instead of manually checking `read_buf.init_len() == buf_len` to see if the read buffer had initialized bytes. However, the `BorrowedBuf` is never marked or set as init within this function, and I think this portion of the code:
```rust
 // SAFETY: These bytes were initialized but not filled in the previous loop
unsafe {
     read_buf.set_init(initialized);
}
```
was removed by mistake. This PR reverts the changes made by rust-lang#150129, so that we can mark the `BorrowedBuf`/`read_buf` as initialized using `BorrowedBuf::set_init` if in a previous iteration the cursor has initialized bytes. This would allow `max_read_size` to not be marked as `usize::max` if the read buffer contains initialized bytes.

Closes: rust-lang#142872
bootstrap: Make `main.rs` a stub that calls into the library crate

As with some other bootstrap tools (e.g. compiletest), bootstrap itself is built as a small binary crate (executable) that links to a larger library crate.

If there is non-trivial code in `main.rs`, then any items it touches need to be publicly exported from the library crate. Those public exports make it harder to identify unused code within bootstrap.

As far as I can tell, there is no compelling rule or principle that determines whether code should be in the entry point or in the library crate, other than historical inertia.

This PR therefore takes all of the code from `main.rs`, and moves it into a new file `cli_main.rs` within the bootstrap library crate. That avoids the need for any public exports other than `cli_main::main` itself.

There should be no change to bootstrap behaviour.

---

This change makes it possible to change all of bootstrap's `pub` items to `pub(crate)`. That migration is left to a future PR, as it involves a fair bit of churn, and requires decisions on how to deal with pub items that are currently unused.

Prior art:
- rust-lang#147506
…turn-span, r=oli-obk

point at closure return expression in non-`FnOnce` E0271 errors

when a closure literal is passed as a function argument and E0271 fires for a projection that isnt `FnOnceOutput`. the error now points at the closures return expression and labels the closure declaration with "this closure". mirroring the existing FnOnce handling in `maybe_detailed_projection_msg`. which cant recover the closure from `self_ty` alone.

fixes rust-lang#42390

r? @estebank
…t, r=oli-obk

interpret: treat pattern and unsafe-binder as ABI-transparent

This was suggested by @Jules-Bertholet in rust-lang#160658. I didn't follow all the discussions for those types. Making them transparent makes sense to me though we should make sure this is explicitly discussed as a stable guarantee when it comes to stabilizing those types.

Tracking issues: rust-lang#123646, rust-lang#130516.

r? @oli-obk
@rust-bors rust-bors Bot added the rollup A PR which is a rollup label Aug 11, 2026
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) 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 Aug 11, 2026
@JonathanBrouwer

Copy link
Copy Markdown
Contributor Author

@bors r+ p=5

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

@rust-bors

rust-bors Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

📌 Commit fca480b has been approved by JonathanBrouwer

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 11, 2026
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Aug 11, 2026
Rollup of 5 pull requests


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

This comment has been minimized.

@rust-bors

rust-bors Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: 9b56d67 (9b56d6744442be97ece7a30a6b1c17d18d8b1631)
Base parent: 0913b18 (0913b18e489ac1011b580e31fa5559654be12bfc)

@rust-bors rust-bors Bot added merged-by-bors This PR was explicitly merged by bors. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Aug 11, 2026
@rust-bors

rust-bors Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

☀️ Test successful - CI
Approved by: JonathanBrouwer
Duration: 3h 16m 7s
Pushing a04c7a0 to main...

@rust-bors
rust-bors Bot merged commit a04c7a0 into rust-lang:main Aug 11, 2026
15 checks passed
@rustbot rustbot added this to the 1.99.0 milestone Aug 11, 2026
@rust-timer

Copy link
Copy Markdown
Collaborator

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#156338 Implement derives for Reborrow and CoerceShared dacc1305e4b2dc7e643575aaabf940a464a21d42 (link)
#158083 Fix perf regression in Read::read_to_end on short reads d… 5dd2ecfe79d5a5468c00ebb27e5502dc62f6c702 (link)
#160829 bootstrap: Make main.rs a stub that calls into the librar… 60f373cfb00a15d5fddd0eee79125bc8f36c6fca (link)
#159839 point at closure return expression in non-FnOnce E0271 er… 3f8aaf94a4af88cf7fb7869733d8c3cfd99844c9 (link)
#160775 interpret: treat pattern and unsafe-binder as ABI-transpare… b9301c566c8bbfad731f18d576065cb76dda6e00 (link)

previous master: f76a50bb82

In the case of a perf regression, run the following command for each PR you suspect might be the cause: @rust-timer build $SHA

@github-actions

Copy link
Copy Markdown
Contributor
What is this? This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.

Comparing f76a50b (parent) -> a04c7a0 (this PR)

Test differences

Show 93 test diffs

Stage 1

  • [ui (polonius)] tests/ui/closures/closure-arg-assoc-type-mismatch.rs: [missing] -> pass (J0)
  • [ui (polonius)] tests/ui/reborrow/custom_marker.rs: pass -> [missing] (J0)
  • [ui (polonius)] tests/ui/reborrow/custom_marker_coerce_shared.rs: pass -> [missing] (J0)
  • [ui (polonius)] tests/ui/reborrow/custom_marker_two_lifetimes.rs: pass -> [missing] (J0)
  • [ui (polonius)] tests/ui/reborrow/derive_coerce_shared.rs: [missing] -> pass (J0)
  • [ui (polonius)] tests/ui/reborrow/derive_coerce_shared_attr.rs: [missing] -> pass (J0)
  • [ui (polonius)] tests/ui/reborrow/derive_invalid_coherence.rs: [missing] -> pass (J0)
  • [ui (polonius)] tests/ui/reborrow/derive_manual_equivalence.rs: [missing] -> pass (J0)
  • [ui (polonius)] tests/ui/reborrow/derive_multiple_lifetimes.rs: [missing] -> pass (J0)
  • [ui (polonius)] tests/ui/reborrow/derive_reborrow.rs: [missing] -> pass (J0)
  • [ui (polonius)] tests/ui/reborrow/derive_unsupported_items.rs: [missing] -> pass (J0)
  • [ui] tests/ui/closures/closure-arg-assoc-type-mismatch.rs: [missing] -> pass (J2)
  • [ui] tests/ui/reborrow/custom_marker.rs: pass -> [missing] (J2)
  • [ui] tests/ui/reborrow/custom_marker_coerce_shared.rs: pass -> [missing] (J2)
  • [ui] tests/ui/reborrow/custom_marker_two_lifetimes.rs: pass -> [missing] (J2)
  • [ui] tests/ui/reborrow/derive_coerce_shared.rs: [missing] -> pass (J2)
  • [ui] tests/ui/reborrow/derive_coerce_shared_attr.rs: [missing] -> pass (J2)
  • [ui] tests/ui/reborrow/derive_invalid_coherence.rs: [missing] -> pass (J2)
  • [ui] tests/ui/reborrow/derive_manual_equivalence.rs: [missing] -> pass (J2)
  • [ui] tests/ui/reborrow/derive_multiple_lifetimes.rs: [missing] -> pass (J2)
  • [ui] tests/ui/reborrow/derive_reborrow.rs: [missing] -> pass (J2)
  • [ui] tests/ui/reborrow/derive_unsupported_items.rs: [missing] -> pass (J2)

Stage 2

  • [ui] tests/ui/closures/closure-arg-assoc-type-mismatch.rs: [missing] -> pass (J1)
  • [ui] tests/ui/reborrow/custom_marker.rs: pass -> [missing] (J1)
  • [ui] tests/ui/reborrow/custom_marker_coerce_shared.rs: pass -> [missing] (J1)
  • [ui] tests/ui/reborrow/custom_marker_two_lifetimes.rs: pass -> [missing] (J1)
  • [ui] tests/ui/reborrow/derive_coerce_shared.rs: [missing] -> pass (J1)
  • [ui] tests/ui/reborrow/derive_coerce_shared_attr.rs: [missing] -> pass (J1)
  • [ui] tests/ui/reborrow/derive_invalid_coherence.rs: [missing] -> pass (J1)
  • [ui] tests/ui/reborrow/derive_manual_equivalence.rs: [missing] -> pass (J1)
  • [ui] tests/ui/reborrow/derive_multiple_lifetimes.rs: [missing] -> pass (J1)
  • [ui] tests/ui/reborrow/derive_reborrow.rs: [missing] -> pass (J1)
  • [ui] tests/ui/reborrow/derive_unsupported_items.rs: [missing] -> pass (J1)

Additionally, 60 doctest diffs were found. These are ignored, as they are noisy.

Job group index

Test dashboard

Run

cargo run --manifest-path src/ci/citool/Cargo.toml -- \
    test-dashboard a04c7a037d59b6dedc9f921e84e391f13a257aa4 --output-dir test-dashboard

And then open test-dashboard/index.html in your browser to see an overview of all executed tests.

Job duration changes

  1. x86_64-gnu-stdlib-semver-check: 5m 25s -> 12m 11s (+124.6%)
  2. x86_64-gnu-gcc-core-tests: 6m 25s -> 13m 56s (+117.0%)
  3. i686-gnu-nopt-2: 1h 10m -> 1h 40m (+41.8%)
  4. x86_64-gnu-next-trait-solver-polonius: 40m 23s -> 56m 45s (+40.5%)
  5. dist-aarch64-linux: 1h 55m -> 2h 41m (+39.5%)
  6. i686-gnu-2: 1h 8m -> 1h 34m (+37.8%)
  7. dist-i686-msvc: 1h 26m -> 1h 58m (+37.7%)
  8. dist-sparcv9-solaris: 1h 13m -> 1h 38m (+33.5%)
  9. dist-x86_64-illumos: 1h 23m -> 1h 50m (+32.7%)
  10. x86_64-mingw-2: 2h 2m -> 2h 38m (+30.0%)
How to interpret the job duration changes?

Job durations can vary a lot, based on the actual runner instance
that executed the job, system noise, invalidated caches, etc. The table above is provided
mostly for t-infra members, for simpler debugging of potential CI slow-downs.

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

Labels

merged-by-bors This PR was explicitly merged by bors. rollup A PR which is a rollup T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) 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.

9 participants