Skip to content

Rollup of 9 pull requests #144360

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 18 commits into from
Jul 23, 2025
Merged

Rollup of 9 pull requests #144360

merged 18 commits into from
Jul 23, 2025

Conversation

matthiaskrgr
Copy link
Member

@matthiaskrgr matthiaskrgr commented Jul 23, 2025

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

Kivooeo and others added 18 commits July 21, 2025 14:52
On the 32-bit win7 target, we use OS TLS instead of native TLS, due to
issues with how the OS handles alignment. Unfortunately, this caused
issues due to the TLS destructors not running, causing memory leaks
among other problems.

On Windows, to support OS TLS, the TlsAlloc family of function is used
by Rust. This function does not support TLS destructors at all. However,
rust has some code to emulate those destructors, by leveraging the TLS
support functionality found in the MSVC CRT (specifically, in tlssup.c
of the CRT). Specifically, the CRT provides the ability to register
callbacks that are called (among other things) on thread destruction. By
registering our own callback, we can run through a list of registered
destructors functions to execute.

To use this functionality, the user must do two things:

1. They must put the address to their callback in a section between
   `.CRT$XLB` and `.CRT$XLY`.
2. They must add a reference to `_tls_used` (or `__tls_used` on x86) to
   make sure the TLS support code in tlssup.c isn't garbage collected by
   the linker.

Prior to this commit, this second bit wasn't being done properly by the
Rust TLS support code. Instead of adding a reference to _tls_used, it
instead had a reference to its own callback to prevent it from getting
GC'd by the linker. While this is _also_ necessary, not having a
reference on _tls_used made the entire support non-functional.

This commit reworks the code to:

1. Add an unconditional `#[used]` attribute on the CALLBACK, which
   should be enough to prevent it from getting GC'd by the linker.
2. Add a reference to `_tls_used`, which should pull the TLS support
   code into the Rust programs and not let it be GC'd by the linker.
Rather than adding `get_unused_rule` to the `TTMacroExpander` trait, put
it on the concrete `MacroRulesMacroExpander`, and downcast to that type
via `Any` in order to call it.

Suggested-by: Vadim Petrochenkov <[email protected]>
This allows us to assume that coverage spans will only be discarded during
codegen in very unusual situations.
1. Rename `make_unclosed_delims_error` and return `Vec<Diag>`
2. change magic number `unclosed_delimiter_show_limit` to const
3. move `eof_err` below parsing logic
4. Add `calculate_spacing` for `bump` and `bump_minimal`

Signed-off-by: xizheyin <[email protected]>
I missed this in the promotion to tier 2 with host tools.

Signed-off-by: Jens Reidel <[email protected]>
this ensures that js-related tests can still be run from within
such a dist tarball.
Remove tidy checks for `tests/ui/issues/`

r? ``````````@jieyouxu``````````

As it is making cleanup efforts more difficult.

This change was discussed here [#t-compiler > Discussion for ui test suite improvements @ 💬](https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/Discussion.20for.20ui.20test.20suite.20improvements/near/529566433)
…isDenton

Fix broken TLS destructors on 32-bit win7

Fixes rust-lang#141300

On the 32-bit win7 target, we use OS TLS instead of native TLS, due to issues with how the OS handles alignment. Unfortunately, this caused issues due to the TLS destructors not running, causing memory leaks among other problems.

On Windows, to support OS TLS, the TlsAlloc family of function is used by Rust. This function does not support TLS destructors at all. However, rust has some code to emulate those destructors, by leveraging the TLS support functionality found in the MSVC CRT (specifically, in tlssup.c of the CRT).

To use this functionality, the user must do two things:

1. They must put the address to their callback in a section between `.CRT$XLB` and `.CRT$XLY`.
2. They must add a reference to `_tls_used` (or `__tls_used` on x86) to make sure the TLS support code in tlssup.c isn't garbage collected by the linker.

Prior to this commit, this second bit wasn't being done properly by the Rust TLS support code. Instead of adding a reference to _tls_used, it instead had a reference to its own callback to prevent it from getting GC'd by the linker. While this is _also_ necessary, not having a reference on _tls_used made the entire support non-functional.

This commit reworks the code to:

1. Add an unconditional `#[used]` attribute on the CALLBACK, which should be enough to prevent it from getting GC'd by the linker.
2. Add a reference to `_tls_used`, which should pull the TLS support code into the Rust programs and not let it be GC'd by the linker.
Clean `rustc/parse/src/lexer` to improve maintainability

This PR refactors the lexer code to improve maintainability and eliminate code duplication.
In the first commit, I improve the error handling:
- rename `make_unclosed_delims_error` to more appropriate `make_mismatched_closing_delims_errors`
- changes return type from Option<Diag> to `Vec<Diag>` to avoid lengthy vec processing at `lex_token_trees`
- use `splice` instead of `extend` to make the logic clearer, since `errs` sounds more generic and better suited as a return value

In the second commit, I replace the magic number 5 with UNCLOSED_DELIMITER_SHOW_LIMIT constant.

In the third commit, I moves `eof_err` function below parsing logic for better code flow.

In the forth one, I extract `calculate_spacing` function to eliminate duplicate spacing logic between `bump` and `bump_minimal` functions.

r? compiler
Don't ICE on non-TypeId metadata within TypeId

fixes rust-lang#144253

r? ``````````@RalfJung``````````
update tests/ui/SUMMARY.md

follow-up of rust-lang#143985 .

r? ```````@jieyouxu```````
…-for-get-unused-rule, r=petrochenkov

mbe: Use concrete type for `get_unused_rule`

Rather than adding `get_unused_rule` to the `TTMacroExpander` trait, put
it on the concrete `MacroRulesMacroExpander`, and downcast to that type
via `Any` in order to call it.

Suggested-by: Vadim Petrochenkov <[email protected]>

r? ```````@petrochenkov```````
coverage: Enlarge empty spans during MIR instrumentation, not codegen

This re-lands the part of rust-lang#140847 that was (hopefully) not responsible for the coverage-instrumentation regressions that caused that PR to be reverted.

---

Enlarging empty spans was historically performed during MIR instrumentation, but had to be moved to codegen as part of larger changes in rust-lang#134497, leading to the status quo. But now there should be no reason not to move that step back to its more logical home in instrumentaion.
…=Kobzol

Add powerpc64le-unknown-linux-musl to CI rustc targets

I missed this in the promotion to tier 2 with host tools.
…e.json, r=Kobzol

bootstrap: add package.json and package-lock.json to dist tarball

this ensures that js-related tests can still be run from within such a dist tarball.

followup to rust-lang#142924

r? ```````@Kobzol```````
@rustbot rustbot added A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-meta Area: Issues & PRs about the rust-lang/rust repository itself A-tidy Area: The tidy tool 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. rollup A PR which is a rollup labels Jul 23, 2025
@matthiaskrgr
Copy link
Member Author

@bors r+ rollup=never p=5

@bors
Copy link
Collaborator

bors commented Jul 23, 2025

📌 Commit d444815 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 Jul 23, 2025
@bors
Copy link
Collaborator

bors commented Jul 23, 2025

⌛ Testing commit d444815 with merge 29a5872...

@bors
Copy link
Collaborator

bors commented Jul 23, 2025

☀️ Test successful - checks-actions
Approved by: matthiaskrgr
Pushing 29a5872 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jul 23, 2025
@bors bors merged commit 29a5872 into rust-lang:master Jul 23, 2025
12 checks passed
@rustbot rustbot added this to the 1.90.0 milestone Jul 23, 2025
@rust-timer
Copy link
Collaborator

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#144173 Remove tidy checks for tests/ui/issues/ 8b7e21329a7c801d942e59c152d3092f022eadcb (link)
#144234 Fix broken TLS destructors on 32-bit win7 76c9b9cff56bf738bbc7447baaf1de7dc4b47a9b (link)
#144239 Clean rustc/parse/src/lexer to improve maintainability 3170f83fac03b6ec7076409722c8c8b7ca080105 (link)
#144256 Don't ICE on non-TypeId metadata within TypeId 2e53efc63663033b54166939105cc157cebbea68 (link)
#144290 update tests/ui/SUMMARY.md bdc681d44b22a037a92549ec6863bf9bc5182d55 (link)
#144292 mbe: Use concrete type for get_unused_rule f046b881f8f8bf085b02ea18d3c7e53fc7ebc086 (link)
#144298 coverage: Enlarge empty spans during MIR instrumentation, n… 2e7c0844ba4de69298076fc4c32871c765075654 (link)
#144311 Add powerpc64le-unknown-linux-musl to CI rustc targets f6502a0553870cb202c51601eace9b7a9d91f41e (link)
#144315 bootstrap: add package.json and package-lock.json to dist t… 0e00009d77cd07ac9df938ff23d77eef1bb8a75f (link)

previous master: 4ff3fa01cb

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

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 4ff3fa0 (parent) -> 29a5872 (this PR)

Test differences

Show 6 test diffs

Stage 1

  • [ui] tests/ui/consts/const_transmute_type_id6.rs: [missing] -> pass (J1)

Stage 2

  • [ui] tests/ui/consts/const_transmute_type_id6.rs: [missing] -> pass (J0)

Additionally, 4 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 29a58723b05d004c2e19ddcf2be80d514401f22e --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-apple-1: 8696.3s -> 10122.4s (16.4%)
  2. pr-check-2: 2671.3s -> 2237.5s (-16.2%)
  3. x86_64-rust-for-linux: 2988.1s -> 2554.4s (-14.5%)
  4. dist-apple-various: 7529.7s -> 8483.6s (12.7%)
  5. dist-aarch64-apple: 7287.8s -> 6493.7s (-10.9%)
  6. pr-check-1: 1513.5s -> 1671.4s (10.4%)
  7. aarch64-msvc-1: 7638.4s -> 6877.4s (-10.0%)
  8. aarch64-gnu-debug: 4403.1s -> 4036.5s (-8.3%)
  9. x86_64-gnu-llvm-19-1: 3665.9s -> 3363.6s (-8.2%)
  10. i686-gnu-2: 6071.3s -> 5575.7s (-8.2%)
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 (29a5872): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

This benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

Results (secondary 1.9%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
1.9% [1.0%, 2.8%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Cycles

Results (secondary -2.4%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.4% [-2.9%, -1.6%] 3
All ❌✅ (primary) - - 0

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 468.179s -> 468.271s (0.02%)
Artifact size: 374.69 MiB -> 374.67 MiB (-0.01%)

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. A-meta Area: Issues & PRs about the rust-lang/rust repository itself A-tidy Area: The tidy tool merged-by-bors This PR was explicitly merged by bors. 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-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.