Skip to content

Conversation

matthiaskrgr
Copy link
Member

@matthiaskrgr matthiaskrgr commented Jun 3, 2025

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

joboet and others added 28 commits May 23, 2025 18:00
The panic machinery uses TLS, so panicking if no TLS keys are left can lead to infinite recursion (see rust-lang#140798 (comment)). Rather than having separate logic for the panic count and the thread name, just always abort the process if a TLS key allocation fails. This also has the benefit of aligning the key-based TLS implementation with the documentation, which does not mention that a panic could also occur because of resource exhaustion.
They're very little value, because they only measure the top-level
`main.rs` or `lib.rs` file. (Other `.rs` files don't get read and parsed
until expansion occurs.)

I saw an example recently where the pre-expansion AST was 3KB in size
and the post-expansion AST was 66MB.

I kept the "POST EXPANSION" in the output header, I think that's useful
information to avoid possible confusion about when the measurement
happens.
It checks that a path has a single segment that matches the given
symbol, and that there are zero generic arguments. It has a single use.

We also have `impl PartialEq<Symbol> for Path` which does exactly the
same thing *except* it doesn't check for zero generic arguments, which
seems like an oversight. It has numerous uses.

This commit removes `Path::is_ident`, adds a test for zero generic
arguments to `PartialEq<Symbol> for Path`, and changes the single use of
`is_ident` to instead use `==`.
- Add AbiMapping for encoding the nuance of deprecated ABIs
makes entry_abi a lowering of the ABI string, so now it can be
```json
  "entry_abi": "C",
  "entry_abi": "win64",
  "entry_abi": "aapcs",
```
`adjust_abi` is not needed and `is_abi_supported` can be a 1-liner.
This adds an `iter!` macro that can be used to create movable
generators.

This also adds a yield_expr feature so the `yield` keyword can be used
within iter! macro bodies. This was needed because several unstable
features each need `yield` expressions, so this allows us to stabilize
them separately from any individual feature.

Co-authored-by: Oli Scherer <[email protected]>
Co-authored-by: Jieyou Xu <[email protected]>
Co-authored-by: Travis Cross <[email protected]>
… r=compiler-errors,traviscross

Add `iter` macro

See related discussion in https://rust-lang.zulipchat.com/#narrow/channel/481571-t-lang.2Fgen/topic/iter!.20macro/near/500784563

very little error case testing so far, but the success path works.

There is also no `IterFn` trait yet, as T-lang didn't consider it something urgently needed I think we can implement it in follow-up PRs.

r? lang for the tests, `@compiler-errors` for the impl
…oss35

std: abort the process on failure to allocate a TLS key

The panic machinery uses TLS, so panicking if no TLS keys are left can lead to infinite recursion (see rust-lang#140798 (comment)). Rather than having separate logic for the panic count and the thread name, just always abort the process if a TLS key allocation fails. This also has the benefit of aligning the key-based TLS implementation with the documentation, which does not mention that a panic could also occur because of resource exhaustion.
…=bjorn3

Replace ad-hoc ABI "adjustments" with an `AbiMap` to `CanonAbi`

Our `conv_from_spec_abi`, `adjust_abi`, and `is_abi_supported` combine to give us a very confusing way of reasoning about what _actual_ calling convention we want to lower our code to and whether we want to compile the resulting code at all. Instead of leaving this code as a miniature adventure game in which someone tries to combine stateful mutations into a Rube Goldberg machine that will let them escape the maze and arrive at the promised land of codegen, we let `AbiMap` devour this complexity. Once you have an `AbiMap`, you can answer which `ExternAbi`s will lower to what `CanonAbi`s (and whether they will lower at all).

Removed:
- `conv_from_spec_abi` replaced by `AbiMap::canonize_abi`
- `adjust_abi` replaced by same
- `Conv::PreserveAll` as unused
- `Conv::Cold` as unused
- `enum Conv` replaced by `enum CanonAbi`

target-spec.json changes:
- If you have a target-spec.json then now your "entry-abi" key will be specified in terms of one of the `"{abi}"` strings Rust recognizes, e.g.
```json
    "entry-abi": "C",
    "entry-abi": "win64",
    "entry-abi": "aapcs",
```
Use the informative error as the main const eval error message

r? `@RalfJung`

I only did the minimal changes necessary to the const eval error machinery. I'd prefer not to mix test changes with refactorings 😆
…kingjubilee

Remove bootstrap cfgs from library/

These `cfg(bootstrap)` are always false now that rust-lang#119899 has landed, and likewise `cfg(not(bootstrap))` is always true. Therefore, we don't need to wait for the usual stage0 bump to clean these up.
…tats, r=compiler-errors

Remove pre-expansion AST stats.

They're very little value, because they only measure the top-level `main.rs` or `lib.rs` file. (Other `.rs` files don't get read and parsed until expansion occurs.)

I saw an example recently where the pre-expansion AST was 3KB in size and the post-expansion AST was 66MB.

I kept the "POST EXPANSION" in the output header, I think that's useful information to avoid possible confusion about when the measurement happens.

r? `@davidtwco`
…mpiler-errors

Remove `Path::is_ident`.

It checks that a path has a single segment that matches the given symbol, and that there are zero generic arguments. It has a single use.

We also have `impl PartialEq<Symbol> for Path` which does exactly the same thing *except* it doesn't check for zero generic arguments, which seems like an oversight. It has numerous uses.

This commit removes `Path::is_ident`, adds a test for zero generic arguments to `PartialEq<Symbol> for Path`, and changes the single use of `is_ident` to instead use `==`.

r? `@wesleywiser`
…mpiler-errors

Add missing `dyn` keywords to tests that do not test for them Part 2

Some more tests that were found
@rustbot rustbot added A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. PG-exploit-mitigations Project group: Exploit mitigations labels Jun 3, 2025
@rustbot rustbot added T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. rollup A PR which is a rollup labels Jun 3, 2025
@matthiaskrgr
Copy link
Member Author

@bors r+ rollup=never p=5

@bors
Copy link
Collaborator

bors commented Jun 3, 2025

📌 Commit a2b6f14 has been approved by matthiaskrgr

It is now in the queue for this repository.

@bors bors 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 Jun 3, 2025
@bors
Copy link
Collaborator

bors commented Jun 3, 2025

⌛ Testing commit a2b6f14 with merge 792fc2b...

@bors
Copy link
Collaborator

bors commented Jun 4, 2025

☀️ Test successful - checks-actions
Approved by: matthiaskrgr
Pushing 792fc2b to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jun 4, 2025
@bors bors merged commit 792fc2b into rust-lang:master Jun 4, 2025
11 checks passed
@rustbot rustbot added this to the 1.89.0 milestone Jun 4, 2025
@rust-timer
Copy link
Collaborator

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#137725 Add iter macro 6fcbe336fe2ad8369a444c42e72d1a64c7e14139 (link)
#141455 std: abort the process on failure to allocate a TLS key 017521487c630364cf41cb6d24ac4a2e2937c622 (link)
#141569 Replace ad-hoc ABI "adjustments" with an AbiMap to `Canon… 9a1cab2bcd7a5067a6787d46a4b06deaf290d1ad (link)
#141698 Use the informative error as the main const eval error mess… 0c5a96402fefa96e8bc2bf4ca8ce7e2969b45b64 (link)
#141925 Remove bootstrap cfgs from library/ 1cf31d1567816965a4585837de1b1c21aabe93a5 (link)
#141943 Remove pre-expansion AST stats. cc029c41ecc74878a0876985186d253e96b25f9c (link)
#141945 Remove Path::is_ident. 463432f6903493334096953a6d399938c106a8bd (link)
#141957 Add missing dyn keywords to tests that do not test for th… 9d3ff27773beae5e3b523e173a3359eb99de711e (link)

previous master: 59aa1e8730

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

Copy link
Contributor

github-actions bot commented Jun 4, 2025

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 59aa1e8 (parent) -> 792fc2b (this PR)

Test differences

Show 120 test diffs

Stage 1

  • errors::verify_const_eval_nullary_intrinsic_fail_34: pass -> [missing] (J0)
  • errors::verify_trait_selection_async_closure_not_fn_18: pass -> [missing] (J0)
  • errors::verify_trait_selection_coro_closure_not_fn_18: [missing] -> pass (J0)
  • [ui] tests/ui/iterators/generator.rs: [missing] -> pass (J1)
  • [ui] tests/ui/iterators/generator_args.rs: [missing] -> pass (J1)
  • [ui] tests/ui/iterators/generator_capture.rs: [missing] -> pass (J1)
  • [ui] tests/ui/iterators/generator_capture_.rs: [missing] -> pass (J1)
  • [ui] tests/ui/iterators/generator_capture_fail.rs: [missing] -> pass (J1)
  • [ui] tests/ui/iterators/generator_capture_fnonce.rs: [missing] -> pass (J1)
  • [ui] tests/ui/iterators/generator_capture_no_lend.rs: [missing] -> pass (J1)
  • [ui] tests/ui/iterators/generator_returned_from_fn.rs: [missing] -> pass (J1)
  • [ui] tests/ui/iterators/iter-macro-not-async-closure-simplified.rs#narrow: [missing] -> pass (J1)
  • [ui] tests/ui/iterators/iter-macro-not-async-closure-simplified.rs#wide: [missing] -> pass (J1)
  • [ui] tests/ui/iterators/iter-macro-not-async-closure.rs: [missing] -> pass (J1)

Stage 2

  • [ui] tests/ui/iterators/generator.rs: [missing] -> pass (J2)
  • [ui] tests/ui/iterators/generator_args.rs: [missing] -> pass (J2)
  • [ui] tests/ui/iterators/generator_capture.rs: [missing] -> pass (J2)
  • [ui] tests/ui/iterators/generator_capture_.rs: [missing] -> pass (J2)
  • [ui] tests/ui/iterators/generator_capture_fail.rs: [missing] -> pass (J2)
  • [ui] tests/ui/iterators/generator_capture_fnonce.rs: [missing] -> pass (J2)
  • [ui] tests/ui/iterators/generator_capture_no_lend.rs: [missing] -> pass (J2)
  • [ui] tests/ui/iterators/generator_returned_from_fn.rs: [missing] -> pass (J2)
  • [ui] tests/ui/iterators/iter-macro-not-async-closure-simplified.rs#narrow: [missing] -> pass (J2)
  • [ui] tests/ui/iterators/iter-macro-not-async-closure-simplified.rs#wide: [missing] -> pass (J2)
  • [ui] tests/ui/iterators/iter-macro-not-async-closure.rs: [missing] -> pass (J2)

Additionally, 95 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 792fc2b033aea7ea7b766e38bdc40f7d6bdce8c3 --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. mingw-check-1: 1591.0s -> 1899.7s (19.4%)
  2. dist-apple-various: 7264.6s -> 6012.1s (-17.2%)
  3. x86_64-rust-for-linux: 2120.5s -> 2461.3s (16.1%)
  4. x86_64-apple-2: 4307.2s -> 4900.4s (13.8%)
  5. i686-gnu-nopt-1: 7134.5s -> 8104.6s (13.6%)
  6. test-various: 3627.7s -> 4105.3s (13.2%)
  7. i686-gnu-1: 7165.5s -> 8052.8s (12.4%)
  8. aarch64-gnu-debug: 3548.8s -> 3958.0s (11.5%)
  9. i686-gnu-2: 5276.7s -> 5874.9s (11.3%)
  10. arm-android: 4719.7s -> 5229.6s (10.8%)
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.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (792fc2b): comparison URL.

Overall result: ❌ regressions - no action needed

@rustbot label: -perf-regression

Instruction count

This is the most reliable metric that we have; it was used to determine the overall result at the top of this comment. However, even this metric can sometimes exhibit noise.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
0.2% [0.2%, 0.2%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results (secondary -3.2%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
0.9% [0.9%, 0.9%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-5.3% [-5.8%, -4.8%] 2
All ❌✅ (primary) - - 0

Cycles

Results (primary -2.0%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-2.0% [-2.0%, -2.0%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -2.0% [-2.0%, -2.0%] 1

Binary size

Results (primary -0.0%, secondary -0.0%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.0% [-0.0%, -0.0%] 4
Improvements ✅
(secondary)
-0.0% [-0.0%, -0.0%] 16
All ❌✅ (primary) -0.0% [-0.0%, -0.0%] 4

Bootstrap: 745.508s -> 745.447s (-0.01%)
Artifact size: 372.31 MiB -> 372.35 MiB (0.01%)

tautschnig pushed a commit to model-checking/verify-rust-std that referenced this pull request Jun 17, 2025
…iaskrgr

Rollup of 8 pull requests

Successful merges:

 - rust-lang#137725 (Add `iter` macro)
 - rust-lang#141455 (std: abort the process on failure to allocate a TLS key)
 - rust-lang#141569 (Replace ad-hoc ABI "adjustments" with an `AbiMap` to `CanonAbi`)
 - rust-lang#141698 (Use the informative error as the main const eval error message)
 - rust-lang#141925 (Remove bootstrap cfgs from library/)
 - rust-lang#141943 (Remove pre-expansion AST stats.)
 - rust-lang#141945 (Remove `Path::is_ident`.)
 - rust-lang#141957 (Add missing `dyn` keywords to tests that do not test for them Part 2)

r? `@ghost`
`@rustbot` modify labels: rollup
bjorn3 pushed a commit to bjorn3/rust that referenced this pull request Jun 24, 2025
…iaskrgr

Rollup of 8 pull requests

Successful merges:

 - rust-lang#137725 (Add `iter` macro)
 - rust-lang#141455 (std: abort the process on failure to allocate a TLS key)
 - rust-lang#141569 (Replace ad-hoc ABI "adjustments" with an `AbiMap` to `CanonAbi`)
 - rust-lang#141698 (Use the informative error as the main const eval error message)
 - rust-lang#141925 (Remove bootstrap cfgs from library/)
 - rust-lang#141943 (Remove pre-expansion AST stats.)
 - rust-lang#141945 (Remove `Path::is_ident`.)
 - rust-lang#141957 (Add missing `dyn` keywords to tests that do not test for them Part 2)

r? `@ghost`
`@rustbot` modify labels: rollup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. merged-by-bors This PR was explicitly merged by bors. PG-exploit-mitigations Project group: Exploit mitigations rollup A PR which is a rollup 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. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants