Rollup of 14 pull requests#159634
Merged
Merged
Conversation
Closures, coroutines, coroutine witnesses and coroutine closures use the same syntax. This used to be copy-paste but gradually departed.
None of the currently public methods are accessible outside `std`, and are unused within. Therefore, they can be restricted to internal use.
Co-Authored-By: Clar Fon <15850505+clarfonthey@users.noreply.github.com>
Co-Authored-By: Clar Fon <15850505+clarfonthey@users.noreply.github.com>
Co-Authored-By: Clar Fon <15850505+clarfonthey@users.noreply.github.com>
Add regression test for rust-lang#120328 Update closure-capture-in-loop-120328.rs Co-Authored-By: adwin <adwinw01@gmail.com>
…e` in non-move closures
* Capture upvar by ref for `.use` in non-move closures
A plain `|| { x.use }` closure marked the upvar capture as `ByUse`,
which clones the value into the closure at construction time. The
`.use` in the body then clones again on every call, so the value was
cloned once more than the number of invocations.
A `ByUse` capture in a non-`move`/`use` closure can only originate from
a `.use` expression in the body; a `use ||` capture clause is handled by
`adjust_for_use_closure` instead. Capture such places by immutable
borrow so the `.use` clones once per evaluation and nothing is cloned
into the closure at construction.
* Add test for clone count of `.use` in non-move closure
the parsed attributes of an item were only fully populated after all finalizers had run, so `finalize_check` (run during finalization) could only inspect attribute *paths* via `FinalizeContext::all_attrs`, not the parsed `AttributeKind`s. split finalization into two passes: first run all finalizers to produce the parsed attributes, then run the cross-attribute checks. The checks are deferred via a new `AttributeParser::deferred_finalize_check`, and can now inspect the fully parsed attributes through a new `FinalizeContext::parsed_attrs` field.
the check that `#[rustc_pub_transparent]` is only applied to `#[repr(transparent)]` types needs to see the parsed `Repr` attribute, so it now lives in `RustcPubTransparentParser::finalize_check`, using the freshly available `FinalizeContext::parsed_attrs`.
When configured with `rust.rpath = false` or using any other custom library configurations, running `rustc` requires a library path too. This was missing from `unstable-book-gen`'s new `rustc -Zhelp`.
And also the fields of `TokenCursor`. It's good hygiene in general, and will allow larger changes to `TokenCursor` down the road (e.g. hopefully avoiding the flattening of token trees to a linear token stream).
…-value-diagnostics, r=petrochenkov Improve cross-namespace name diagnostics Close rust-lang#86290 Cross-namespace name matches now use the ordinary missing-name diagnostic while preserving its error code and suggestions. The diagnostic adds a note identifying the item found in another namespace, while same-namespace wrong-kind diagnostics remain unchanged. The UI expectations cover cross-namespace combinations across the resolver suite, including preservation of existing suggestions.
…out-change-comment, r=nnethercote Clarify the comment about stage1/stage2 discrepancy in input-stats test I was very confused by this comment. The test in question breaks when you change AST types and the comment says "Type layout sometimes change" which seems to imply that you have to do the `ignore-stage1` flip to fix it. But we do these layout changes all the time and I haven't seen anybody to do this. It only became clear only when I dug through history and found the last time the `ignore-stage1` was used here (on layout algorithm change in 2023). It's only relevant when type layouts change in _rustc output_, not in rustc source code. r? nnethercote
Member
Author
Contributor
This comment has been minimized.
This comment has been minimized.
rust-bors Bot
pushed a commit
that referenced
this pull request
Jul 21, 2026
Rollup of 14 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 try-job: x86_64-mingw-1 try-job: i686-msvc-*
This comment has been minimized.
This comment has been minimized.
Contributor
Contributor
This was referenced Jul 21, 2026
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 5a8cd23 (parent) -> cde3f8a (this PR) Test differencesShow 454 test diffsStage 1
Stage 2
Additionally, 436 doctest diffs were found. These are ignored, as they are noisy. Job group index
Test dashboardRun cargo run --manifest-path src/ci/citool/Cargo.toml -- \
test-dashboard cde3f8aee5a30928872e2438e3f18238a3fa306c --output-dir test-dashboardAnd then open Job duration changes
How to interpret the job duration changes?Job durations can vary a lot, based on the actual runner instance |
Collaborator
|
📌 Perf builds for each rolled up PR:
previous master: 5a8cd237d4 In the case of a perf regression, run the following command for each PR you suspect might be the cause: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Successful merges:
.usein non-move closures #157270 (ergonomic_clones_dotuse_capture_by_ref: Capture upvar by ref for.usein non-move closures)check_rustc_pub_transparentinto the attribute parser #158496 (Movecheck_rustc_pub_transparentinto the attribute parser)std::io::bufferedtoalloc::io#158547 (Movestd::io::bufferedtoalloc::io)-Znext-solver: ICE with closure capturing iterated variable in 2021 edition #120328)TokenTreeCursorprivate #159601 (MakeTokenTreeCursorprivate)r? @ghost
Create a similar rollup